gtoken

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MulanPSL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	Data interface{}
	jwt.StandardClaims
}

type Token

type Token struct {
	Secret  string
	TimeOut time.Duration
}

func (*Token) GenerateToken

func (t *Token) GenerateToken(claims Claims) (string, error)

产生token的函数

func (*Token) ParseToken

func (t *Token) ParseToken(token string) (*Claims, error)

验证token的函数

Jump to

Keyboard shortcuts

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