Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenToken ¶
func GenToken(claims *MyCustomClaims) (string, error)
GenToken generate JWT from user infos with secret
Types ¶
type MyCustomClaims ¶
type MyCustomClaims struct { jwt.RegisteredClaims UserId uint64 `json:"userId"` Username string `json:"username"` Role int32 `json:"role"` }
func ParseToken ¶
func ParseToken(tokenString string) (*MyCustomClaims, error)
ParseToken extract infos from token
Click to show internal directories.
Click to hide internal directories.