user

package
v0.0.0-...-b113d69 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID       string
	Email    string
	Password string

	CreatedAt  time.Time
	LoggedInAt time.Time
}

func NewAccount

func NewAccount(email Email, password Password) *Account

func (*Account) Create

func (a *Account) Create()

func (*Account) Login

func (a *Account) Login()

type Email

type Email string

func NewEmail

func NewEmail(email string) (Email, error)

func (Email) String

func (e Email) String() string

type Password

type Password string

func NewPassword

func NewPassword(p string) (Password, error)

func (Password) String

func (p Password) String() string

type ReadWriter

type ReadWriter interface {
	Reader
	Writer
}

type Reader

type Reader interface {
	FindAccountByID(ctx context.Context, id string) (*Account, error)
}

type Service

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

func NewService

func NewService(repo ReadWriter) *Service

func (*Service) CreateAccount

func (s *Service) CreateAccount(ctx context.Context, email, password string) (*Account, error)

type Writer

type Writer interface {
	AddAccount(ctx context.Context, a *Account) error
}

Jump to

Keyboard shortcuts

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