biz

package
v0.0.0-...-b12402e Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: MIT, MIT Imports: 6 Imported by: 0

README

Biz

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserNotFound = errors.New("user not found")
)

ProviderSet is biz providers.

Functions

This section is empty.

Types

type Address

type Address struct {
	Id       int64
	Name     string
	Mobile   string
	Address  string
	PostCode string
}

type AddressRepo

type AddressRepo interface {
	CreateAddress(ctx context.Context, u *Address) (*Address, error)
	GetAddress(ctx context.Context, id int64) (*Address, error)
	ListAddress(ctx context.Context, uid int64) ([]*Address, error)
}

type AddressUseCase

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

func NewAddressUseCase

func NewAddressUseCase(repo AddressRepo, logger log.Logger) *AddressUseCase

func (*AddressUseCase) Create

func (uc *AddressUseCase) Create(ctx context.Context, uid int64, a *Address) (*Address, error)

func (*AddressUseCase) Get

func (uc *AddressUseCase) Get(ctx context.Context, id int64) (*Address, error)

func (*AddressUseCase) List

func (uc *AddressUseCase) List(ctx context.Context, uid int64) ([]*Address, error)

type Card

type Card struct {
	Id      int64
	CardNo  string
	CCV     string
	Expires string
}

type CardRepo

type CardRepo interface {
	CreateCard(ctx context.Context, c *Card) (*Card, error)
	GetCard(ctx context.Context, id int64) (*Card, error)
	ListCard(ctx context.Context, id int64) ([]*Card, error)
}

type CardUseCase

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

func NewCardUseCase

func NewCardUseCase(repo CardRepo, logger log.Logger) *CardUseCase

func (*CardUseCase) Create

func (uc *CardUseCase) Create(ctx context.Context, c *Card) (*Card, error)

func (*CardUseCase) Get

func (uc *CardUseCase) Get(ctx context.Context, id int64) (*Card, error)

func (*CardUseCase) List

func (uc *CardUseCase) List(ctx context.Context, uid int64) ([]*Card, error)

type User

type User struct {
	Id       int64
	Username string
	Password string
}

type UserRepo

type UserRepo interface {
	CreateUser(ctx context.Context, u *User) (*User, error)
	GetUser(ctx context.Context, id int64) (*User, error)
	VerifyPassword(ctx context.Context, u *User) (bool, error)
	FindByUsername(ctx context.Context, username string) (*User, error)
}

type UserUseCase

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

func NewUserUseCase

func NewUserUseCase(repo UserRepo, logger log.Logger) *UserUseCase

func (*UserUseCase) Create

func (uc *UserUseCase) Create(ctx context.Context, u *User) (*User, error)

func (*UserUseCase) Get

func (uc *UserUseCase) Get(ctx context.Context, id int64) (*User, error)

func (*UserUseCase) GetUserByUsername

func (uc *UserUseCase) GetUserByUsername(ctx context.Context, in *v1.GetUserByUsernameReq) (*v1.GetUserByUsernameReply, error)

func (*UserUseCase) Save

func (uc *UserUseCase) Save(ctx context.Context, in *v1.SaveUserReq) (*v1.SaveUserReply, error)

func (*UserUseCase) VerifyPassword

func (uc *UserUseCase) VerifyPassword(ctx context.Context, u *User) (bool, error)

Jump to

Keyboard shortcuts

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