tokencommon

package
v1.1.23 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TOKEN_EXPIRES int = -20 // token 过期
	TOKEN_VALID   int = 0   // token 有效
)

Variables

View Source
var TokenKey []byte // = []byte("profession_key")

Functions

func CheckToken

func CheckToken(tokenString string) (int, interface{}, error)

验证token

func GenerateToken

func GenerateToken(timeout int64, gd interface{}) (string, error)

GenerateToken 生成Token

func InitToken

func InitToken(tokenKey string)

Types

type MyClaims

type MyClaims struct {
	Data interface{} `json:"data,omitempty"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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