user

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FetchMaxLimit        = 100
	MinDisplayNameLength = 2
	MaxDisplayNameLength = 32
	MinPasswordLength    = 6
	MaxPasswordLength    = 64
	MaxOrders            = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchConfig

type FetchConfig struct {
	Filter *model.UserFilter
	Offset int
	Limit  int
	Sort   []string
	Count  bool
}

type Repository

type Repository interface {
	Store(ctx context.Context, input *model.UserInput) (*model.User, error)
	UpdateMany(ctx context.Context, f *model.UserFilter, input *model.UserInput) ([]*model.User, error)
	Delete(ctx context.Context, f *model.UserFilter) ([]*model.User, error)
	Fetch(ctx context.Context, cfg *FetchConfig) ([]*model.User, int, error)
}

type Usecase

type Usecase interface {
	Store(ctx context.Context, input *model.UserInput) (*model.User, error)
	UpdateOneByID(ctx context.Context, id int, input *model.UserInput) (*model.User, error)
	UpdateMany(ctx context.Context, f *model.UserFilter, input *model.UserInput) ([]*model.User, error)
	Delete(ctx context.Context, f *model.UserFilter) ([]*model.User, error)
	Fetch(ctx context.Context, cfg *FetchConfig) ([]*model.User, int, error)
	GetByID(ctx context.Context, id int) (*model.User, error)
	GetByCredentials(ctx context.Context, email, password string) (*model.User, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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