Documentation ¶
Index ¶
Constants ¶
View Source
const ( JWTSigningMethodHS256 = "HS256" JWTSigningMethodHS384 = "HS384" JWTSigningMethodHS512 = "HS512" )
View Source
const CasbinRBACModel = `` /* 251-byte string literal not displayed */
View Source
const JWTClaimsKey = "JWT_CLAIMS"
View Source
const SaltLength = 8
View Source
const UserKey = "LOGIN_USER"
Variables ¶
View Source
var ( JWTTokenMalformed = errors.New("jwt token malformed") JWTTokenExpired = errors.New("jwt token expired") JWTTokenNotValidYet = errors.New("jwt token not valid yet") JWTTokenInvalid = errors.New("jwt token invalid") )
View Source
var Enforcer *casbin.Enforcer
Functions ¶
func InitCasbin ¶
func InitCasbin()
Types ¶
type JWT ¶
type JWT struct {
SigningKey []byte
}
func (*JWT) CreateToken ¶
create jwt token
func (*JWT) ParseToken ¶
parse token
func (*JWT) RefreshToken ¶
update token
type JWTClaims ¶
type JWTClaims struct {
jwt.StandardClaims
}
Click to show internal directories.
Click to hide internal directories.