Versions in this module Expand all Collapse all v0 v0.2.0 Mar 21, 2018 v0.1.0 Mar 21, 2018 Changes in this version + var ErrCouldNotClearDB = errors.New("could not clear database") + var ErrCouldNotDialDB = errors.New("could not dial database") + var ErrInvalidQuery = errors.New("invalid query") + var ErrModelNotSet = errors.New("model not set") + var ErrNoDBSession = errors.New("no database session") + type Repo struct + func NewRepo(url, dbPrefix, collection string) (*Repo, error) + func NewRepoWithSession(session *mgo.Session, dbPrefix, collection string) (*Repo, error) + func Repository(repo eh.ReadRepo) *Repo + func (r *Repo) Clear(ctx context.Context) error + func (r *Repo) Close() + func (r *Repo) Collection(ctx context.Context, f func(*mgo.Collection) error) error + func (r *Repo) Find(ctx context.Context, id eh.UUID) (eh.Entity, error) + func (r *Repo) FindAll(ctx context.Context) ([]eh.Entity, error) + func (r *Repo) FindCustom(ctx context.Context, callback func(*mgo.Collection) *mgo.Query) ([]interface{}, error) + func (r *Repo) FindCustomIter(ctx context.Context, callback func(*mgo.Collection) *mgo.Query) (eh.Iter, error) + func (r *Repo) Parent() eh.ReadRepo + func (r *Repo) Remove(ctx context.Context, id eh.UUID) error + func (r *Repo) Save(ctx context.Context, entity eh.Entity) error + func (r *Repo) SetEntityFactory(f func() eh.Entity)