repository

package
v0.0.0-...-9d76aac Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UsersMongo

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

UsersMongo defines users repository for MongoDB database.

func NewUserMongo

func NewUserMongo(client *mongo.Client) *UsersMongo

NewUserMongo constructs new UsersMongo repository instance.

func (*UsersMongo) GetByID

func (r *UsersMongo) GetByID(userID string) (*user.User, error)

GetByID retrieves user from the collection by given `userID`.

func (*UsersMongo) Upsert

func (r *UsersMongo) Upsert(u user.User) error

Upsert stores user in the database.

Jump to

Keyboard shortcuts

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