Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateToken ¶
func GenerateToken(appKey, appSecret string, i ClaimsInterface) (string, error)
func GenerateUserToken ¶
func GenerateUserToken(user_id int, i ClaimsInterface) (string, error)
Types ¶
type Claims ¶
type Claims struct { AppKey string `json:"app_key"` AppSecret string `json:"app_secret"` jwt.StandardClaims }
func ParseToken ¶
func ParseToken(token string, i ClaimsInterface) (*Claims, error)
type ClaimsInterface ¶
type UserClaims ¶
type UserClaims struct { UserId int `json:"user_id"` jwt.StandardClaims }
TODO: 待优化
func ParseUserToken ¶
func ParseUserToken(token string, i ClaimsInterface) (*UserClaims, error)
Click to show internal directories.
Click to hide internal directories.