MCPcopy Index your code
hub / github.com/apache/answer / NewData

Function NewData

internal/base/data/data.go:47–53  ·  view source on GitHub ↗

NewData new data instance

(db *xorm.Engine, cache cache.Cache)

Source from the content-addressed store, hash-verified

45
46// NewData new data instance
47func NewData(db *xorm.Engine, cache cache.Cache) (*Data, func(), error) {
48 cleanup := func() {
49 log.Info("closing the data resources")
50 _ = db.Close()
51 }
52 return &Data{DB: db, Cache: cache}, cleanup, nil
53}
54
55// NewDB new database instance
56func NewDB(debug bool, dataConf *Database) (*xorm.Engine, error) {

Callers 4

initTestDataSourceFunction · 0.92
ResetPasswordFunction · 0.92
initTestDataSourceFunction · 0.92
initApplicationFunction · 0.92

Calls 2

InfoMethod · 0.65
CloseMethod · 0.65

Tested by 2

initTestDataSourceFunction · 0.74
initTestDataSourceFunction · 0.74