jwt

package
v1.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const TokenExpireDuration = 24 * time.Hour //过期时间

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(uid int64) (tokenStr string)

GenerateToken 生成JWT

Types

type AuthClaim

type AuthClaim struct {
	Uid int64 `json:"uid"`
	jwt.RegisteredClaims
}

func ParseToken

func ParseToken(tokenString string) (auth AuthClaim, Valid bool)

ParseToken 解析JWT

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL