store

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIndexCreation = errors.New("failed to create index")
)
View Source
var (
	//ErrNotFound signals that a user could not be found
	ErrNotFound = errors.New("user not found")
)

Functions

This section is empty.

Types

type Middleware

type Middleware func(UserStore) UserStore

func LoggingMiddleware

func LoggingMiddleware(logger zerolog.Logger) Middleware

type UserStore

type UserStore interface {
	Create(ctx context.Context, user *model.User) (string, error)
	FindByID(ctx context.Context, id string) (*model.User, error)
	FindByEMail(ctx context.Context, email string) (*model.User, error)
	HasUsersWithRole(ctx context.Context, role model.Role) (bool, error)
	Delete(ctx context.Context, id string) error
	// contains filtered or unexported methods
}

UserStore is responsible for storing and fetching of users

func NewUserStore

func NewUserStore(client *mongo.Client, logger zerolog.Logger) (UserStore, error)

Jump to

Keyboard shortcuts

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