jwt

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTokenInvalid = errors.New("token is invalid")
)

Functions

This section is empty.

Types

type Instance

type Instance struct{}

Instance provide the jwt algorithm component

func New

func New() *Instance

func (Instance) GenerateToken

func (impl Instance) GenerateToken(sign []byte, claims jwt.Claims) (string, error)

CreateToken 生成token

func (Instance) ParseToken

func (impl Instance) ParseToken(sign []byte, token string) (jwt.Claims, error)

ParseToken return jwt.MapClaims and error

Jump to

Keyboard shortcuts

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