Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrLoginFailed = errors.New("login failed") ErrPasswordFailed = errors.New("password failed") ErrUserDeactivate = errors.New("user is deactivated") )
View Source
var (
ErrUserNotFound = errors.New("user not found")
)
View Source
var ProviderSet = wire.NewSet(NewUserUseCase, 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 (ac *AuthUseCase) Login(ctx context.Context, req *v1.LoginReq) (*v1.LoginReply, error)
type UserRepo ¶
type UserRepo interface { GetUser(ctx context.Context, id int64) (*User, error) FindByUsername(ctx context.Context, username string) (*User, error) VerifyPassword(ctx context.Context, u *User, password string) error ListUser(ctx context.Context, req *v1.ListUserReq) (*v1.ListUserReply, error) ChangeActive(ctx context.Context, id int64, active bool) (bool, error) }
type UserUseCase ¶
type UserUseCase struct {
// contains filtered or unexported fields
}
func NewUserUseCase ¶
func NewUserUseCase(repo UserRepo, logger log.Logger) *UserUseCase
func (*UserUseCase) ChangeActive ¶
func (*UserUseCase) Get ¶
func (uc *UserUseCase) Get(ctx context.Context, req *v1.GetUserReq) (*v1.GetUserReply, error)
func (*UserUseCase) List ¶
func (uc *UserUseCase) List(ctx context.Context, req *v1.ListUserReq) (*v1.ListUserReply, error)
Click to show internal directories.
Click to hide internal directories.