Documentation
¶
Index ¶
- Constants
- Variables
- type Group
- func (cm *Group) CheckCaptchaStatus(key string) bool
- func (cm *Group) CheckEmailCaptcha(email string, captcha string) error
- func (cm *Group) GenerateJWT(custom jwt.RegisteredClaims) (string, error)
- func (cm *Group) HashPassword(username string, password string) string
- func (cm *Group) MakeCustomClaims(userId uint) jwt.RegisteredClaims
- func (cm *Group) ParseToken(tokenStr string) (jwt.RegisteredClaims, error)
- func (cm *Group) RefreshJWT(custom jwt.RegisteredClaims) (token string, newCustom jwt.RegisteredClaims, err error)
- func (cm *Group) SetEmailCaptchaCache(email string, emailCaptcha string, expirationTime time.Duration) error
Constants ¶
View Source
const ExpiresAt time.Duration = 90 * 24 * time.Hour
Variables ¶
View Source
var Common = new(common)
View Source
var GroupApp = new(Group)
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) CheckCaptchaStatus ¶
CheckCaptchaStatus 判断验证码是否开启
func (*Group) CheckEmailCaptcha ¶
检查邮件验证码错误次数 如果该邮件验证码错误次数过多 则短时禁用该邮件以保护该邮件
func (*Group) GenerateJWT ¶
func (cm *Group) GenerateJWT(custom jwt.RegisteredClaims) (string, error)
func (*Group) HashPassword ¶
func (*Group) MakeCustomClaims ¶
func (cm *Group) MakeCustomClaims(userId uint) jwt.RegisteredClaims
func (*Group) ParseToken ¶
func (cm *Group) ParseToken(tokenStr string) (jwt.RegisteredClaims, error)
func (*Group) RefreshJWT ¶
func (cm *Group) RefreshJWT(custom jwt.RegisteredClaims) (token string, newCustom jwt.RegisteredClaims, err error)
Click to show internal directories.
Click to hide internal directories.