repository

package
v0.0.0-...-ac7271b Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserRepo

type UserRepo struct {
	// contains filtered or unexported fields
}

User repository

func NewUserRepo

func NewUserRepo(db *mongo.Database) *UserRepo

Instantiate new UserRepo

func (*UserRepo) DeleteByID

func (r *UserRepo) DeleteByID(id string) (bool, error)

Delete user by its id

func (*UserRepo) FindAll

func (r *UserRepo) FindAll() ([]model.User, error)

Find all user

func (*UserRepo) FindByEmail

func (r *UserRepo) FindByEmail(email string) (model.User, error)

Find user by its email

func (*UserRepo) FindByID

func (r *UserRepo) FindByID(id string) (model.User, error)

Find user by its id

func (*UserRepo) Save

func (r *UserRepo) Save(u *model.User) (model.User, error)

Save single user

func (*UserRepo) Update

func (r *UserRepo) Update(u *model.User) (model.User, error)

Update single user

Jump to

Keyboard shortcuts

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