Documentation
¶
Index ¶
- type AuthRepo
- type AuthUsecase
- func (uc *AuthUsecase) CheckUser(ctx context.Context, email string) (bool, error)
- func (uc *AuthUsecase) CheckUserTelephone(ctx context.Context, telephoneAreaCode, telephone string) (bool, error)
- func (uc *AuthUsecase) ResetPassword(ctx context.Context, params *ResetPasswordParams) (*LoginResult, error)
- func (uc *AuthUsecase) TelephoneLogin(ctx context.Context, params *TelephoneLoginParams) (*LoginResult, error)
- func (uc *AuthUsecase) TelephoneRegister(ctx context.Context, params *TelephoneRegisterParams) (*LoginResult, error)
- func (uc *AuthUsecase) TelephoneResetPassword(ctx context.Context, params *TelephoneResetPasswordParams) (*LoginResult, error)
- func (uc *AuthUsecase) UserLogin(ctx context.Context, params *UserLoginParams) (*LoginResult, error)
- func (uc *AuthUsecase) UserRegister(ctx context.Context, params *UserRegisterParams) (*LoginResult, error)
- type LoginResult
- type RequestMeta
- type ResetPasswordParams
- type TelephoneLoginParams
- type TelephoneRegisterParams
- type TelephoneResetPasswordParams
- type UserLoginParams
- type UserRegisterParams
- type VerifyConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthRepo ¶
type AuthRepo interface {
CheckUserExistByEmail(ctx context.Context, email string) (bool, error)
CheckUserExistByTelephone(ctx context.Context, telephoneAreaCode, telephone string) (bool, error)
GetVerifyConfig(ctx context.Context) (*VerifyConfig, error)
VerifyCaptcha(ctx context.Context, config *VerifyConfig, meta RequestMeta) error
UserLogin(ctx context.Context, params *UserLoginParams) (*LoginResult, error)
TelephoneLogin(ctx context.Context, params *TelephoneLoginParams) (*LoginResult, error)
UserRegister(ctx context.Context, params *UserRegisterParams) (*LoginResult, error)
TelephoneRegister(ctx context.Context, params *TelephoneRegisterParams) (*LoginResult, error)
ResetPassword(ctx context.Context, params *ResetPasswordParams) (*LoginResult, error)
TelephoneResetPassword(ctx context.Context, params *TelephoneResetPasswordParams) (*LoginResult, error)
}
type AuthUsecase ¶
type AuthUsecase struct {
// contains filtered or unexported fields
}
func NewAuthUsecase ¶
func NewAuthUsecase(repo AuthRepo, logger log.Logger) *AuthUsecase
func (*AuthUsecase) CheckUserTelephone ¶
func (*AuthUsecase) ResetPassword ¶
func (uc *AuthUsecase) ResetPassword(ctx context.Context, params *ResetPasswordParams) (*LoginResult, error)
func (*AuthUsecase) TelephoneLogin ¶
func (uc *AuthUsecase) TelephoneLogin(ctx context.Context, params *TelephoneLoginParams) (*LoginResult, error)
func (*AuthUsecase) TelephoneRegister ¶
func (uc *AuthUsecase) TelephoneRegister(ctx context.Context, params *TelephoneRegisterParams) (*LoginResult, error)
func (*AuthUsecase) TelephoneResetPassword ¶
func (uc *AuthUsecase) TelephoneResetPassword(ctx context.Context, params *TelephoneResetPasswordParams) (*LoginResult, error)
func (*AuthUsecase) UserLogin ¶
func (uc *AuthUsecase) UserLogin(ctx context.Context, params *UserLoginParams) (*LoginResult, error)
func (*AuthUsecase) UserRegister ¶
func (uc *AuthUsecase) UserRegister(ctx context.Context, params *UserRegisterParams) (*LoginResult, error)
type LoginResult ¶
type LoginResult struct {
Token string
}
type RequestMeta ¶
type ResetPasswordParams ¶
type ResetPasswordParams struct {
Email string
Password string
Code string
Meta RequestMeta
}
type TelephoneLoginParams ¶
type TelephoneLoginParams struct {
TelephoneAreaCode string
Telephone string
Password string
TelephoneCode string
Meta RequestMeta
}
type TelephoneRegisterParams ¶
type TelephoneResetPasswordParams ¶
type TelephoneResetPasswordParams struct {
TelephoneAreaCode string
Telephone string
Password string
Code string
Meta RequestMeta
}
type UserLoginParams ¶
type UserLoginParams struct {
Email string
Password string
Meta RequestMeta
}
type UserRegisterParams ¶
type UserRegisterParams struct {
Email string
Password string
Invite string
Code string
Meta RequestMeta
}
Click to show internal directories.
Click to hide internal directories.