Documentation ¶
Index ¶
- func GenerateHashID(id uint, salt string, length int) string
- func GenerateSecretKey(length int) string
- func GetPreloads(ctx context.Context) []string
- func GetRawID(id string, salt string, length int) uint
- func JWT(signingKey []byte, uid int64, username, avatar string, gender int, ...) string
- func ParseJWT(signingKey []byte, token string) (*jwt.Token, error)
- func RandString(len int) string
- type MyCustomClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateHashID ¶
GenerateHashID ..
func JWT ¶
func JWT(signingKey []byte, uid int64, username, avatar string, gender int, tokenExpire time.Duration, issuer string) string
JWT 生成jwt字符串
Types ¶
type MyCustomClaims ¶
type MyCustomClaims struct { UID int64 `json:"uid"` //用户id Username string `json:"username"` Avatar string `json:"avatar"` Gender int `json:"gender"` jwt.StandardClaims }
MyCustomClaims jwt自定义内容
Click to show internal directories.
Click to hide internal directories.