Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func JwtAuth ¶
func JwtAuth(secretKey string) app.HandlerFunc
Types ¶
type CustomClaims ¶
type CustomClaims struct { ID int64 Identity string jwt.StandardClaims }
type JWT ¶
type JWT struct {
SigningKey []byte
}
func (*JWT) CreateToken ¶
func (j *JWT) CreateToken(claims CustomClaims) (string, error)
CreateToken to create a token
func (*JWT) ParseToken ¶
func (j *JWT) ParseToken(tokenString string) (*CustomClaims, error)
ParseToken to parse a token
Click to show internal directories.
Click to hide internal directories.