{"modulePath":"github.com/apache/answer","version":"v1.7.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package data\n\n## Functions\n\n```go\nfunc NewCache(c *CacheConf) (cache.Cache, func(), error)\n```\nNewCache new cache instance\n\n```go\nfunc NewDB(debug bool, dataConf *Database) (*xorm.Engine, error)\n```\nNewDB new database instance\n\n## Types\n\n```go\ntype CacheConf struct {\n\tFilePath string `json:\"file_path\" mapstructure:\"file_path\" yaml:\"file_path\"`\n}\n```\nCacheConf cache\n\n```go\ntype Data struct {\n\tDB    *xorm.Engine\n\tCache cache.Cache\n}\n```\nData data\n\n```go\nfunc NewData(db *xorm.Engine, cache cache.Cache) (*Data, func(), error)\n```\nNewData new data instance\n\n```go\ntype Database struct {\n\tDriver          string `json:\"driver\" mapstructure:\"driver\" yaml:\"driver\"`\n\tConnection      string `json:\"connection\" mapstructure:\"connection\" yaml:\"connection\"`\n\tConnMaxLifeTime int    `json:\"conn_max_life_time\" mapstructure:\"conn_max_life_time\" yaml:\"conn_max_life_time,omitempty\"`\n\tMaxOpenConn     int    `json:\"max_open_conn\" mapstructure:\"max_open_conn\" yaml:\"max_open_conn,omitempty\"`\n\tMaxIdleConn     int    `json:\"max_idle_conn\" mapstructure:\"max_idle_conn\" yaml:\"max_idle_conn,omitempty\"`\n}\n```\nDatabase database config\n\n","path":"github.com/apache/answer/internal/base/data","name":"data","synopsis":"","isRedistributable":true}
