Documentation ¶
Index ¶
- func InitSingKey(singKey1 string)
- type JwtUtil
- func (j *JwtUtil) Hs256Parse(token_ string) (*jwt.Token, error)
- func (j *JwtUtil) Hs256RefreshToken(token_ string) (string, error)
- func (j *JwtUtil) Hs256Verify(token_ string) bool
- func (j *JwtUtil) NewHs256Token(user User) (string, error)
- func (j *JwtUtil) ParseUserFromToken(token_ string) (*User, error)
- type User
- type UserClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JwtUtil ¶
type JwtUtil struct { ExpiresAt int64 //过期时间,秒 ExpiresRenewalTimeAt int64 //续签过期时间 RenewalTime float64 //续签时间 }
func NewJwtUtil ¶
func NewJwtUtil() *JwtUtil
func (*JwtUtil) Hs256Parse ¶
func (*JwtUtil) Hs256RefreshToken ¶
续签token
func (*JwtUtil) Hs256Verify ¶
func (*JwtUtil) NewHs256Token ¶
生成一个sh256加密的jwt
type UserClaims ¶
type UserClaims struct { User jwt.RegisteredClaims }
Click to show internal directories.
Click to hide internal directories.