token

package
v0.0.0-...-f59a6ac Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteToken

func DeleteToken(token string) error

删除token

func GenToken

func GenToken(id int, username string) (string, error)

生成token

func ParseHeaderToken

func ParseHeaderToken(authorization string) (string, error)

解析请求头

func RefreshToken

func RefreshToken(token string) error

刷新token

func ValidToken

func ValidToken(claims *TokenClaims) error

Types

type TokenClaims

type TokenClaims struct {
	Uuid     string `json:"uuid"`
	UserId   int    `json:"userId"`
	Username string `json:"username"`
	jwt.RegisteredClaims
}

func ParseToken

func ParseToken(value string) (*TokenClaims, error)

解析token

Jump to

Keyboard shortcuts

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