Documentation ¶
Index ¶
- Variables
- type User
- type UserRepo
- type UserUseCase
- func (uc *UserUseCase) ChangeActive(ctx context.Context, req *v1.ChangeActiveReq) (*v1.ChangeActiveReply, error)
- func (uc *UserUseCase) Create(ctx context.Context, u *User) (*User, error)
- func (uc *UserUseCase) Get(ctx context.Context, id int64) (*User, error)
- func (uc *UserUseCase) GetUserByUsername(ctx context.Context, req *v1.GetUserByUsernameReq) (*v1.GetUserByUsernameReply, error)
- func (uc *UserUseCase) List(ctx context.Context, pageIndex, pageSize int) ([]*User, int, error)
- func (uc *UserUseCase) Save(ctx context.Context, req *v1.SaveUserReq) (*v1.SaveUserReply, error)
- func (uc *UserUseCase) VerifyPassword(ctx context.Context, u *User) (bool, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUserNotFound = errors.New("user not found")
)
View Source
var ProviderSet = wire.NewSet(NewUserUseCase)
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type UserRepo ¶
type UserRepo interface { GetUser(ctx context.Context, id int64) (*User, error) FindByUsername(ctx context.Context, username string) (*User, error) CreateUser(ctx context.Context, u *User) (*User, error) VerifyPassword(ctx context.Context, u *User) (bool, error) ListUser(ctx context.Context, pageIndex, pageSize int) ([]*User, int, error) ChangeActive(ctx context.Context, u *User, isActive 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 (uc *UserUseCase) ChangeActive(ctx context.Context, req *v1.ChangeActiveReq) (*v1.ChangeActiveReply, error)
func (*UserUseCase) GetUserByUsername ¶
func (uc *UserUseCase) GetUserByUsername(ctx context.Context, req *v1.GetUserByUsernameReq) (*v1.GetUserByUsernameReply, error)
func (*UserUseCase) Save ¶
func (uc *UserUseCase) Save(ctx context.Context, req *v1.SaveUserReq) (*v1.SaveUserReply, error)
func (*UserUseCase) VerifyPassword ¶
Click to show internal directories.
Click to hide internal directories.