Documentation ¶
Index ¶
- Variables
- type DB
- type DBObjector
- type MongoDB
- 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
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DatabaseUpdateTimeout = time.Second * 5 DatabaseLoadTimeout = time.Second * 5 )
View Source
var ErrNoResult = errors.New("db return no result")
db find no result
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { MigrateTable(tblName string, indexNames ...string) error SaveObject(tblName string, x DBObjector) error SaveFields(tblName string, x DBObjector, fields map[string]interface{}) error LoadObject(tblName, key string, value interface{}, x DBObjector) error LoadArray(tblName, key string, storeIndex int64, pool *sync.Pool) ([]interface{}, error) DeleteObject(tblName string, x DBObjector) error Exit() }
func NewMongoDB ¶
func NewMongoDB(ctx *cli.Context) DB
type DBObjector ¶
DBObjector save and load with all structure
type MongoDB ¶
type MongoDB struct { sync.RWMutex utils.WaitGroupWrapper // contains filtered or unexported fields }
func (*MongoDB) DeleteObject ¶
func (m *MongoDB) DeleteObject(tblName string, x DBObjector) error
func (*MongoDB) LoadObject ¶
func (m *MongoDB) LoadObject(tblName, key string, value interface{}, x DBObjector) error
func (*MongoDB) MigrateTable ¶
migrate collection
func (*MongoDB) SaveFields ¶
func (m *MongoDB) SaveFields(tblName string, x DBObjector, fields map[string]interface{}) error
func (*MongoDB) SaveObject ¶
func (m *MongoDB) SaveObject(tblName string, x DBObjector) error
Click to show internal directories.
Click to hide internal directories.