Documentation ¶
Index ¶
Constants ¶
View Source
const ( TokenKey = "access-token" //CKGToken the key of jwt payload in gin context CKGToken = "claims" )
View Source
const ( SuccessCode = 200 NotFoundCode = 404 SystemErrorCode = 500 )
View Source
const ( UnknownCacheErrorCode = 5001 UnknownDBErrorCode = 5002 )
View Source
const ( NotFoundMsg = "404 not found" SuccessMsg = "success" ServerErrorMsg = "server internal error" IllegalInputErrMsg = "input is illegal" AccountPasswordErrMsg = "incorrect account or password" EmptyTokenErrMsg = "token not obtained" TokenHasExpiredMsg = "token has expired" )
View Source
const (
AccountPasswordErrCode = 4031
)
View Source
const (
IllegalInputErrCode = 4001
)
Variables ¶
View Source
var StrongPwd validator.Func = func(fl validator.FieldLevel) bool { pwd, ok := fl.Field().Interface().(string) if ok { return IsStrongPwd(pwd) } return false }
StrongPwd Strong password validator.
Functions ¶
func IsStrongPwd ¶
isStrongPwd the password must contain three of uppercase and lowercase letters, numbers, and special characters, and the password length is 8-16
Types ¶
type ResponseError ¶
func (ResponseError) Code ¶
func (re ResponseError) Code() int
func (ResponseError) Msg ¶
func (re ResponseError) Msg() string
Click to show internal directories.
Click to hide internal directories.