Documentation ¶
Overview ¶
Package auth encrypt and compare password string.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func JWTAuth ¶ added in v0.0.2
func JWTAuth(signKey string) gin.HandlerFunc
Types ¶
type CustomClaims ¶ added in v0.0.2
type JWT ¶ added in v0.0.2
type JWT struct {
SigningKey []byte
}
func (*JWT) CreateToken ¶ added in v0.0.2
func (j *JWT) CreateToken(claims CustomClaims) (string, error)
创建一个token
func (*JWT) ParseToken ¶ added in v0.0.2
func (j *JWT) ParseToken(tokenString string) (*CustomClaims, error)
解析 token
Click to show internal directories.
Click to hide internal directories.