store

package
v0.0.0-...-3d0596a Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store of data in mongo

func New

func New(cfg *config.Config) (*Store, error)

New Store

func (*Store) Close

func (s *Store) Close()

Close mongo session

func (*Store) CreateUser

func (s *Store) CreateUser(ctx context.Context, u *model.User) error

CreateUser insert new user

func (*Store) GetUserByEmail

func (s *Store) GetUserByEmail(ctx context.Context, email string) (*model.User, error)

GetUserByEmail search user by email

func (*Store) GetUserByID

func (s *Store) GetUserByID(ctx context.Context, id bson.ObjectId) (*model.User, error)

GetUserByID search user collection by id

func (*Store) GetUserCount

func (s *Store) GetUserCount(ctx context.Context) (int, error)

GetUserCount return count of users

Jump to

Keyboard shortcuts

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