repository

package
v0.0.0-...-6f9a9ad Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound not found
	ErrNotFound = errors.New("not found")
	// ErrNothingToUpdate nothing to update
	ErrNothingToUpdate = errors.New("nothing to update")
	// ErrMissingUserID missing user id
	ErrMissingUserID = errors.New("missing user id")
)

Functions

This section is empty.

Types

type ErrDuplicateFields

type ErrDuplicateFields struct {
	Field string
}

ErrDuplicateFields duplicate fields

func (ErrDuplicateFields) Error

func (e ErrDuplicateFields) Error() string

type Repository

type Repository interface {
	GetUser(ctx context.Context, userID string) (models.User, error)
	GetUsersN(ctx context.Context) ([]models.User, error)
	GetUserByEmail(ctx context.Context, email string) (models.User, error)
	SaveUser(ctx context.Context, user models.User) (models.User, error)
	AddRoleToUser(ctx context.Context, userID string, role models.Role) error
	UpdateUser(ctx context.Context, user models.User) (models.User, error)
}

Repository represents the methods of data persistance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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