Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TokenExpired = errors.New("token is expired") TokenNotValidYet = errors.New("token not active yet") TokenMalformed = errors.New("that's not even a token") TokenInvalid = errors.New("couldn't handle this token") )
一些常量
Functions ¶
func GenerateToken ¶
func GenerateToken(claims CustomClaims) (string, error)
func RefreshToken ¶
Types ¶
type CustomClaims ¶
type CustomClaims struct { jwt.StandardClaims UserId int64 `json:"user_id"` }
自定义载荷
func ParseToken ¶
func ParseToken(tokenString string) (*CustomClaims, error)
Click to show internal directories.
Click to hide internal directories.