nosql

package
v0.0.0-...-ab1da25 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound              = errors.New("user not found")
	ErrUniqueEmail           = errors.New("email is not unique")
	ErrAuthenticationFailure = errors.New("authentication failed")
)

Functions

This section is empty.

Types

type Store

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

func NewStore

func NewStore(log *zap.SugaredLogger, db driver.Database) *Store

NewStore constructs the api for data access.

func (*Store) Authenticate

func (s *Store) Authenticate(ctx context.Context, email string, password string) (user.User, error)

func (*Store) Create

func (s *Store) Create(ctx context.Context, usr user.User) (user.User, error)

Create inserts a new user into the database.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, email mail.Address) (user.User, error)

Delete deletes a user from the database

func (*Store) QueryByEmail

func (s *Store) QueryByEmail(ctx context.Context, email string) (user.User, error)

QueryById queries a user by email.

func (*Store) QueryByID

func (s *Store) QueryByID(ctx context.Context, id string) (user.User, error)

QueryById queries a user by id.

func (*Store) Update

func (s *Store) Update(ctx context.Context, updateUser user.UpdateUser) (user.User, error)

Update updates a user by data.

Jump to

Keyboard shortcuts

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