Documentation ¶
Index ¶
- Constants
- Variables
- func CheckPassword(password, hashPassword string) bool
- func DefaultGetValidParams(c *gin.Context, params interface{}) error
- func GenSaltPassword(password string) (string, error)
- func GetTranslation(c *gin.Context) (ut.Translator, error)
- func GetValidator(c *gin.Context) (*validator.Validate, error)
- func RegisterJwt(secret string)
- type BaseClaims
- type CustomClaims
Constants ¶
View Source
const ( ValidatorKey = "ValidatorKey" TranslatorKey = "TranslatorKey" )
View Source
const ( LoginURL = "/api/user/login" LogoutURL = "/api/user/logout" WebShellURL = "/api/k8s/pod/webshell" )
Variables ¶
View Source
var ( AdminDefaultAuth uint = 111 AdminDefaultAuthStr = strconv.Itoa(int(AdminDefaultAuth)) UserDefaultAuth uint = 222 UserDefaultAuthStr = strconv.Itoa(int(UserDefaultAuth)) UserSubDefaultAuth uint = 2221 UserSubDefaultAuthStr = strconv.Itoa(int(UserSubDefaultAuth)) )
View Source
var JWTToken jwtToken
Functions ¶
func CheckPassword ¶
func DefaultGetValidParams ¶
func GenSaltPassword ¶
func GetTranslation ¶
func GetValidator ¶
func RegisterJwt ¶
func RegisterJwt(secret string)
Types ¶
type BaseClaims ¶
type CustomClaims ¶
type CustomClaims struct { BaseClaims jwt.StandardClaims }
CustomClaims 自定义token中携带的信息
Click to show internal directories.
Click to hide internal directories.