user

package
v0.0.0-...-5376e58 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPassword = errors.New("invalid password")
)

Functions

This section is empty.

Types

type Email

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

func NewEmail

func NewEmail(email string) Email

func (Email) IsEmpty

func (e Email) IsEmpty() bool

func (Email) Set

func (e Email) Set(email mail.Address)

func (Email) String

func (e Email) String() mail.Address

type Name

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

func NewName

func NewName(un string) Name

func (Name) IsEmpty

func (n Name) IsEmpty() bool

func (Name) Set

func (n Name) Set(name string)

func (Name) String

func (n Name) String() string

type Password

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

func NewPassword

func NewPassword(un string) Password

func (Password) IsEmpty

func (p Password) IsEmpty() bool

func (Password) Set

func (p Password) Set(password string)

func (Password) String

func (p Password) String() string

type Repo

type Repo interface {
	QueryByID(ctx context.Context, userID uuid.UUID) (User, error)
	Create(ctx context.Context, u User) error
	Update(ctx context.Context, u User) error
	Delete(ctx context.Context, userID uuid.UUID) error
}

type Service

type Service interface {
	QueryByID(ctx context.Context, userID uuid.UUID) (User, error)
	Create(ctx context.Context, nu UpdateUser) (User, error)
	Update(ctx context.Context, u User, uu UpdateUser) (User, error)
	Delete(ctx context.Context, userID uuid.UUID) error
}

func NewSvc

func NewSvc(repo Repo) Service

type Svc

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

func (Svc) Create

func (s Svc) Create(ctx context.Context, newU UpdateUser) (User, error)

func (Svc) Delete

func (s Svc) Delete(ctx context.Context, userID uuid.UUID) error

func (Svc) QueryByID

func (s Svc) QueryByID(ctx context.Context, userID uuid.UUID) (User, error)

func (Svc) Update

func (s Svc) Update(ctx context.Context, u User, newU UpdateUser) (User, error)

type UpdateUser

type UpdateUser struct {
	Name     Name
	Email    Email
	Password Password
}

type User

type User struct {
	ID           uuid.UUID
	Name         Name
	Email        Email
	PasswordHash []byte
}

Directories

Path Synopsis
repositories

Jump to

Keyboard shortcuts

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