Documentation
¶
Index ¶
- type IUserUseCase
- type UserUseCase
- func (u *UserUseCase) CheckPasswordHash(password, hash string) (bool, error)
- func (u *UserUseCase) Create(ctx context.Context, userModel *postgresModel.User) (*postgresModel.User, error)
- func (u *UserUseCase) GetUserById(ctx context.Context, id int64) (*postgresModel.User, error)
- func (u *UserUseCase) GetUserByUsername(ctx context.Context, username string) (*postgresModel.User, error)
- func (u *UserUseCase) GetUsers(ctx context.Context, arg ...func(*gorm.DB)) ([]*entity.User, error)
- func (u *UserUseCase) HashPassword(password string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IUserUseCase ¶
type IUserUseCase interface {
Create(ctx context.Context, userModel *postgresModel.User) (*postgresModel.User, error)
GetUsers(ctx context.Context, arg ...func(*gorm.DB)) ([]*entity.User, error)
GetUserById(ctx context.Context, id int64) (*postgresModel.User, error)
GetUserByUsername(ctx context.Context, username string) (*postgresModel.User, error)
HashPassword(password string) (string, error)
CheckPasswordHash(password, hash string) (bool, error)
}
type UserUseCase ¶
type UserUseCase struct {
UserRepo postgresRepo.IUserRepository
UserCacheRepository redisRepo.IUserCacheRepository
UserLogRepository clickhouseRepo.IUserLogRepository
}
func (*UserUseCase) CheckPasswordHash ¶
func (u *UserUseCase) CheckPasswordHash(password, hash string) (bool, error)
func (*UserUseCase) Create ¶
func (u *UserUseCase) Create(ctx context.Context, userModel *postgresModel.User) (*postgresModel.User, error)
func (*UserUseCase) GetUserById ¶
func (u *UserUseCase) GetUserById(ctx context.Context, id int64) (*postgresModel.User, error)
func (*UserUseCase) GetUserByUsername ¶
func (u *UserUseCase) GetUserByUsername(ctx context.Context, username string) (*postgresModel.User, error)
func (*UserUseCase) HashPassword ¶
func (u *UserUseCase) HashPassword(password string) (string, error)
Click to show internal directories.
Click to hide internal directories.