Versions in this module Expand all Collapse all v1 v1.0.1 Nov 25, 2020 Changes in this version + var DatabaseLoadTimeout = time.Second * 5 + var DatabaseUpdateTimeout = time.Second * 5 + var ErrNoResult = errors.New("db return no result") + type DB interface + DeleteObject func(tblName string, x DBObjector) error + Exit func() + LoadArray func(tblName, key string, storeIndex int64, pool *sync.Pool) ([]interface{}, error) + LoadObject func(tblName, key string, value interface{}, x DBObjector) error + MigrateTable func(tblName string, indexNames ...string) error + SaveFields func(tblName string, x DBObjector, fields map[string]interface{}) error + SaveObject func(tblName string, x DBObjector) error + func NewDB(ctx *cli.Context) DB + func NewMongoDB(ctx *cli.Context) DB + type DBObjector interface + AfterLoad func() error + GetObjID func() int64 + type MongoDB struct + func (m *MongoDB) DeleteObject(tblName string, x DBObjector) error + func (m *MongoDB) Exit() + func (m *MongoDB) LoadArray(tblName string, key string, storeIndex int64, pool *sync.Pool) ([]interface{}, error) + func (m *MongoDB) LoadObject(tblName, key string, value interface{}, x DBObjector) error + func (m *MongoDB) MigrateTable(name string, indexNames ...string) error + func (m *MongoDB) SaveFields(tblName string, x DBObjector, fields map[string]interface{}) error + func (m *MongoDB) SaveObject(tblName string, x DBObjector) error