Documentation ¶
Index ¶
- type DAO
- func (d *DAO) Count(ctx context.Context) (int64, error)
- func (d *DAO) GetAll(ctx context.Context, items interface{}, limit int64) error
- func (d *DAO) GetByID(ctx context.Context, id string, item interface{}) error
- func (d *DAO) GetList(ctx context.Context, items interface{}, query map[string]interface{}, ...) error
- func (d *DAO) GetName() string
- func (d *DAO) Insert(ctx context.Context, item interface{}) (string, error)
- func (d *DAO) RemoveByID(ctx context.Context, id string) error
- func (d *DAO) UpdateByID(ctx context.Context, id string, item interface{}) error
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DAO ¶
type DAO struct {
// contains filtered or unexported fields
}
DAO for handling access to a mongoDB collection
func (*DAO) GetList ¶
func (d *DAO) GetList(ctx context.Context, items interface{}, query map[string]interface{}, limit int64) error
GetList - return a list of items from the collection using a query
func (*DAO) RemoveByID ¶
RemoveByID - removes an item from the collection
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session wraps a mgo.Database to embed methods in models.
func NewSession ¶
NewSession creates a session for mongoDB
Click to show internal directories.
Click to hide internal directories.