daos

package
v0.0.0-...-2d64d47 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2016 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 DefaultPostDAO

type DefaultPostDAO struct {
	Session *mgo.Session
}

func NewDefaulPostDAO

func NewDefaulPostDAO(session *mgo.Session) *DefaultPostDAO

func (*DefaultPostDAO) Create

func (uM *DefaultPostDAO) Create(nPost *webmsgspec.NewPostDTO) (u *models.PostModel, err error)

func (*DefaultPostDAO) Delete

func (uM *DefaultPostDAO) Delete(id bson.ObjectId) error

func (*DefaultPostDAO) Ensures

func (u *DefaultPostDAO) Ensures()

func (*DefaultPostDAO) Find

func (uM *DefaultPostDAO) Find(id bson.ObjectId) (u *models.PostModel, err error)

func (*DefaultPostDAO) FindByEmail

func (uM *DefaultPostDAO) FindByEmail(email string) (u *models.PostModel, err error)

func (*DefaultPostDAO) FindMany

func (uM *DefaultPostDAO) FindMany(query map[string]interface{}, sortBy []string, offset int, limit int) ([]*models.PostModel, error)

func (*DefaultPostDAO) Replace

func (uM *DefaultPostDAO) Replace(updPost *webmsgspec.UpdatePostDTO) (u *models.PostModel, err error)

type PostDAO

type PostDAO interface {
	Find(bson.ObjectId) (*models.PostModel, error)
	FindMany(query map[string]interface{}, sortBy []string, offset int, limit int) ([]*models.PostModel, error)
	Create(*webmsgspec.NewPostDTO) (*models.PostModel, error)
	Replace(*webmsgspec.UpdatePostDTO) (*models.PostModel, error)
	Delete(bson.ObjectId) error
}

Jump to

Keyboard shortcuts

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