repo

package
v0.0.0-...-0308a11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IODMRepository

type IODMRepository interface {
	Save(odm.IEntity) error
	Delete(odm.IEntity) error
	GetByID(bson.ObjectId, odm.IEntity) error
}

IODMRepository is an interface wrapping odm.Repository. This interface is created for mocking purposes.

type IUser

type IUser interface {
	GetByID(bson.ObjectId) (*model.User, error)
	Save(*model.User) error
	DeleteByID(bson.ObjectId) error
	Paginate(bson.M, int, int) ([]*model.User, *odm.PaginationInfo, error)
}

type User

type User struct {
	CollectionName string
	Repo           *odm.Repository
}

func NewUserRepo

func NewUserRepo() *User

func (*User) DeleteByID

func (u *User) DeleteByID(ID bson.ObjectId) error

func (*User) GetByID

func (u *User) GetByID(ID bson.ObjectId) (*model.User, error)

func (*User) Paginate

func (u *User) Paginate(query bson.M, perPage, page int) ([]*model.User, *odm.PaginationInfo, error)

func (*User) Save

func (u *User) Save(user *model.User) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL