Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { Init(ctx context.Context, option ...Option) (err error) Insert(coll string, instance interface{}) (id string, err error) Find(coll string, filter interface{}, callback CallBack, skip int64, limit int64, sort int) error FindOne(coll string, filter interface{}, result interface{}) (err error) Delete(coll string, filter interface{}) (err error) Update(coll string, filter, update interface{}) (err error) Count(coll string, filter interface{}) (num int64, err error) Aggregation(coll string, pipe interface{}, cursorF interface{}) (err error) // 聚合查询 }
数据库
type Option ¶
type Option func(opts *Options)
func WithDatabase ¶
func WithTimeout ¶
func WithUsername ¶
type Options ¶
type Options struct { Addr string Username string Password string Timeout time.Duration Database string CollIndex map[string]string }
func DefaultOpts ¶
func DefaultOpts() *Options
type Store ¶
type Store interface { Init(ctx context.Context, option ...Option) (err error) Upload(name string, source io.Reader) (id string, err error) Download(id interface{}, stream io.Writer) (size int64, err error) FindFile(filter interface{}, cursorF interface{}, skip, limit int32) (err error) DeleteFile(id interface{}) (err error) }
存储
Click to show internal directories.
Click to hide internal directories.