Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JWTAuth ¶
func JWTAuth(key []byte) gin.HandlerFunc
Types ¶
type JWT ¶
type JWT struct { // 在hmac中key 必须是Key must be []byte // 在rsa中key 必须是*rsa.PrivateKey 对象 SigningKey []byte }
func (*JWT) CreateToken ¶
CreateToken 创建一个token
func (*JWT) ParseToken ¶
func (j *JWT) ParseToken(tokenString string) (*models.CustomClaims, error)
ParseToken 解析 token
Click to show internal directories.
Click to hide internal directories.