user

package
v0.0.0-...-18ada3e Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

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

func New

func New(dbConn database.Conn) *Repository

func (*Repository) Create

func (r *Repository) Create(ctx context.Context, u *storage.User) (*storage.User, error)

Create a new user.

func (*Repository) Delete

func (r *Repository) Delete(ctx context.Context, id uuid.UUID) error

func (*Repository) Get

func (r *Repository) Get(ctx context.Context, id uuid.UUID) (*storage.User, error)

GetByID get a user by id.

func (*Repository) GetByEmail

func (r *Repository) GetByEmail(ctx context.Context, email string) (*storage.User, error)

GetByEmail get a user by email. This is used for authentication and so it also returns the password.

func (*Repository) List

func (r *Repository) List(ctx context.Context, pagination storage.Pagination, sorting storage.UserOrderBy, conditions ...storage.Condition) ([]*storage.User, error)

List implements user.Repository.

func (*Repository) Update

func (r *Repository) Update(ctx context.Context, in *storage.User, fields []storage.UserField) (*storage.User, error)

Jump to

Keyboard shortcuts

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