Documentation ¶
Index ¶
- type AuthService
- func (as *AuthService) AuthUser(email string, password string) (*user_model.User, bool)
- func (as *AuthService) GetRandomCode(length int64) (string, string, error)
- func (as *AuthService) HashPassword(password string) (string, error)
- func (as *AuthService) PasswordIsComplex(password string) bool
- func (as *AuthService) SendPasswordResetCode(email string) error
- func (as *AuthService) SendTwoFactorCode(user *user_model.User) error
- func (as *AuthService) VerifyPassword(passwordHash string, password string) bool
- func (as *AuthService) VerifyPasswordResetCode(id int64, code string) bool
- func (as *AuthService) VerifyTwoFactorCode(id int64, code string) bool
- type IAuthService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService struct { MailService mail_service.IMailService RepositoriesGroup *repository.RepositoriesGroup }
func DefaultAuthService ¶
func DefaultAuthService(rg *repository.RepositoriesGroup, mailService *mail_service.MailService) *AuthService
func (*AuthService) AuthUser ¶
func (as *AuthService) AuthUser(email string, password string) (*user_model.User, bool)
func (*AuthService) GetRandomCode ¶
func (as *AuthService) GetRandomCode(length int64) (string, string, error)
func (*AuthService) HashPassword ¶
func (as *AuthService) HashPassword(password string) (string, error)
func (*AuthService) PasswordIsComplex ¶
func (as *AuthService) PasswordIsComplex(password string) bool
func (*AuthService) SendPasswordResetCode ¶
func (as *AuthService) SendPasswordResetCode(email string) error
func (*AuthService) SendTwoFactorCode ¶
func (as *AuthService) SendTwoFactorCode(user *user_model.User) error
func (*AuthService) VerifyPassword ¶
func (as *AuthService) VerifyPassword(passwordHash string, password string) bool
func (*AuthService) VerifyPasswordResetCode ¶
func (as *AuthService) VerifyPasswordResetCode(id int64, code string) bool
func (*AuthService) VerifyTwoFactorCode ¶
func (as *AuthService) VerifyTwoFactorCode(id int64, code string) bool
type IAuthService ¶
type IAuthService interface { AuthUser(string, string) (*user_model.User, bool) HashPassword(string) (string, error) SendPasswordResetCode(string) error VerifyPassword(string, string) bool VerifyPasswordResetCode(int64, string) bool SendTwoFactorCode(*user_model.User) error VerifyTwoFactorCode(int64, string) bool PasswordIsComplex(string) bool GetRandomCode(int64) (string, string, error) }
Click to show internal directories.
Click to hide internal directories.