Documentation ¶
Index ¶
- Variables
- type Address
- type AuthUseCase
- type Beer
- type Card
- type CatalogRepo
- type CatalogUseCase
- type Image
- type User
- type UserRepo
- type UserUseCase
- func (uc *UserUseCase) CreateAddress(ctx context.Context, uid int64, a *Address) (*Address, error)
- func (uc *UserUseCase) CreateCard(ctx context.Context, uid int64, c *Card) (*Card, error)
- func (uc *UserUseCase) GetAddress(ctx context.Context, id int64) (*Address, error)
- func (uc *UserUseCase) GetCard(ctx context.Context, id int64) (*Card, error)
- func (uc *UserUseCase) ListAddress(ctx context.Context, uid int64) ([]*Address, error)
- func (uc *UserUseCase) ListCard(ctx context.Context, uid int64) ([]*Card, error)
- func (uc *UserUseCase) Logout(ctx context.Context, u *User) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPasswordInvalid = errors.New("password invalid") ErrUsernameInvalid = errors.New("username invalid") ErrUserNotFound = errors.New("user not found") )
View Source
var (
ErrLoginFailed = errors.New("login failed")
)
View Source
var ProviderSet = wire.NewSet( NewUserUseCase, NewCatalogUseCase, NewAuthUseCase, )
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type AuthUseCase ¶
type AuthUseCase struct {
// contains filtered or unexported fields
}
func NewAuthUseCase ¶
func NewAuthUseCase(conf *conf.Auth, userRepo UserRepo) *AuthUseCase
func (*AuthUseCase) Login ¶
func (receiver *AuthUseCase) Login(ctx context.Context, req *v1.LoginReq) (*v1.LoginReply, error)
func (*AuthUseCase) Register ¶
func (receiver *AuthUseCase) Register(ctx context.Context, req *v1.RegisterReq) (*v1.RegisterReply, error)
type CatalogRepo ¶
type CatalogUseCase ¶
type CatalogUseCase struct {
// contains filtered or unexported fields
}
func NewCatalogUseCase ¶
func NewCatalogUseCase(repo CatalogRepo, logger log.Logger) *CatalogUseCase
type UserRepo ¶
type UserRepo interface { Find(ctx context.Context, id int64) (*User, error) FindByUsername(ctx context.Context, username string) (*User, error) Save(ctx context.Context, u *User) error VerifyPassword(ctx context.Context, u *User, password string) error CreateAddress(ctx context.Context, uid int64, a *Address) (*Address, error) GetAddress(ctx context.Context, id int64) (*Address, error) ListAddress(ctx context.Context, uid int64) ([]*Address, error) CreateCard(ctx context.Context, uid int64, c *Card) (*Card, error) GetCard(ctx context.Context, id int64) (*Card, error) ListCard(ctx context.Context, id int64) ([]*Card, error) }
type UserUseCase ¶
type UserUseCase struct {
// contains filtered or unexported fields
}
func NewUserUseCase ¶
func NewUserUseCase(repo UserRepo, logger log.Logger, authUc *AuthUseCase) *UserUseCase
func (*UserUseCase) CreateAddress ¶
func (*UserUseCase) CreateCard ¶
func (*UserUseCase) GetAddress ¶
func (*UserUseCase) ListAddress ¶
Click to show internal directories.
Click to hide internal directories.