Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateToken ¶
func GenerateToken[T any](payload JwtPayload[T]) (tokenString string, err error)
GenerateToken 生成token eg 指定userId为int64类型,过期时间为9小时 tokenString := kk_jwt.GenerateToken[int64](userId, 9*time.Hour)
Types ¶
type JwtPayload ¶
type MyClaims ¶
type MyClaims[K any] struct { Payload JwtPayload[K] jwt.RegisteredClaims }
Click to show internal directories.
Click to hide internal directories.