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:") )
View Source
var Claims = new(claims)
Functions ¶
This section is empty.
Types ¶
type JWT ¶
type JWT struct {
SigningKey []byte
}
func (*JWT) CreateToken ¶
func (j *JWT) CreateToken(claims *request.CustomClaims) (string, error)
CreateToken 创建一个token
func (*JWT) CreateTokenByOldToken ¶
CreateTokenByOldToken 旧token 换新token 使用归并回源避免并发问题
func (*JWT) ParseToken ¶
func (j *JWT) ParseToken(tokenString string) (*request.CustomClaims, error)
ParseToken 解析 token
Click to show internal directories.
Click to hide internal directories.