Documentation
¶
Index ¶
- func ListAll(dao D, db string, group string, from int, size int, unmarshal int, opt QOpt) (data []interface{}, err error)
- type Config
- type D
- type DBSchema
- type DOpt
- type DaoManager
- func (o *DaoManager) Destroy()
- func (o *DaoManager) Get(id string) (dao D, err error)
- func (o *DaoManager) GetSchema() *Schema
- func (o *DaoManager) Init(producer DaoProducer, schemaOpts map[string]interface{}, ...) error
- func (o *DaoManager) InitDao(name string, options map[string]interface{}) (D, error)
- func (o *DaoManager) Release(id string)
- func (o *DaoManager) Terminate() error
- type DaoProducer
- type FieldSchema
- type GroupSchema
- type QOpt
- type Schema
- type UOpt
- type VFactor
- type VType
- type VTypeCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Name string Type string Host string Port int User string Pass string Database string MaxIdle int KeepAlive int IdleTimeout int Extra map[string]interface{} Options map[string]interface{} DBMapping map[string]interface{} Framework *Schema // contains filtered or unexported fields }
type D ¶
type D interface { Configure( name string, daotype string, host string, port int, user string, pass string, database string, options map[string]interface{}) error Conn() (agent interface{}, err error) Close() error IsConnected() bool Agent() (agent interface{}, err error) SelectDB(db string) error UpdateDB(db string, options interface{}, create bool, override bool, opt UOpt) (interface{}, error) UpdateGroup(db string, group string, options interface{}, create bool, override bool, opt UOpt) (interface{}, error) Exists(db string, group string, ids []interface{}) (int64, error) ExistDB(db string) (bool, error) ExistGroup(db string, group string) (bool, error) GetDB(db string, opt QOpt) (interface{}, error) GetGroup(db string, group string, opt QOpt) (interface{}, error) Keys(db string, group string, wildcard string, opt QOpt) (keys []string, err error) Get(db string, group string, id interface{}, unmarshal int, opt QOpt) (ret interface{}, err error) Gets(db string, group string, ids []interface{}, unmarshal int, opt QOpt) (rets []interface{}, err error) List(db string, group string, from int, size int, unmarshal int, opt QOpt) (rets []interface{}, cursor int, err error) Query(db string, query string, args []interface{}, opt QOpt) (interface{}, error) Update(db string, group string, id interface{}, val interface{}, override bool, marshal int, opt UOpt) (interface{}, error) Updates(db string, group string, ids []interface{}, vals []interface{}, override bool, marshal int, opt UOpt) (interface{}, error) UpdateBatch(db string, groups []string, ids []interface{}, vals []interface{}, override bool, marshal int, opt UOpt) (interface{}, error) Delete(db string, group string, id interface{}, opt DOpt) (interface{}, error) Deletes(db string, group string, ids []interface{}, opt DOpt) (interface{}, error) Script(db string, group string, id interface{}, script string, args []interface{}, opt QOpt) (interface{}, error) }
type DaoManager ¶
type DaoManager struct {
// contains filtered or unexported fields
}
func GetManager ¶
func GetManager() *DaoManager
func (*DaoManager) Destroy ¶
func (o *DaoManager) Destroy()
func (*DaoManager) GetSchema ¶
func (o *DaoManager) GetSchema() *Schema
func (*DaoManager) Init ¶
func (o *DaoManager) Init(producer DaoProducer, schemaOpts map[string]interface{}, databaseOpts map[string]interface{}) error
func (*DaoManager) InitDao ¶
func (o *DaoManager) InitDao(name string, options map[string]interface{}) (D, error)
func (*DaoManager) Release ¶
func (o *DaoManager) Release(id string)
func (*DaoManager) Terminate ¶
func (o *DaoManager) Terminate() error
type DaoProducer ¶
type DaoProducer func(manager *DaoManager, name string, opts map[string]interface{}) (D, error)
type FieldSchema ¶
type FieldSchema struct { Name string Type VType TypeCode VTypeCode Factor VFactor Format string Group *GroupSchema Parent *FieldSchema Sub map[string]*FieldSchema }
func (*FieldSchema) Init ¶
func (field *FieldSchema) Init(name string, fieldOpts interface{})
type GroupSchema ¶
type GroupSchema struct { Name string Key *FieldSchema Field map[string]*FieldSchema DB *DBSchema }
func (*GroupSchema) Init ¶
func (group *GroupSchema) Init(name string, groupOptions map[string]interface{})
type Schema ¶
type Schema struct { Name string DB map[string]*DBSchema // contains filtered or unexported fields }
func (*Schema) GetField ¶
func (s *Schema) GetField(db string, group string, field string) *FieldSchema
func (*Schema) GetGroupKey ¶
Click to show internal directories.
Click to hide internal directories.