utils

package
v0.0.0-...-66c47ec Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessTokenExpireDuration  = 24 * time.Hour //令牌过期时间
	RefreshTokenExpireDuration = 7 * 24 * time.Hour
)

Variables

This section is empty.

Functions

func GenToken

func GenToken(userID uint64, username string) (aToken, rToken string, err error)

func GetID

func GetID() (id uint64, err error)

GetID 返回生成的id值

Types

type MyCustomClaims

type MyCustomClaims struct {
	UserID   uint64 `json:"user_id"`
	Username string `json:"username"`
	jwt.RegisteredClaims
}

func ParseToken

func ParseToken(tokenString string) (claims *MyCustomClaims, err error)

Jump to

Keyboard shortcuts

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