jwt

package
v0.0.0-...-f9f9384 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TokenExpiredErr = errors.New("token expired")
View Source
var TokenInvalidErr = errors.New("token invalid")
View Source
var TokenMalformedErr = errors.New("token malformed error")
View Source
var TokenNotValidYetErr = errors.New("token not valid yet")

Functions

func GenToken

func GenToken(claim Certification) (string, error)

func Initialize

func Initialize(key string, ex int)

Types

type Certification

type Certification struct {
	jwt.StandardClaims
	// 自定义字段,添加自己需要的信息
	UserId   int
	Username string
	//盐,随机数
	Salt string
}

认证对象

func ParseToken

func ParseToken(token string) (*Certification, error)

Jump to

Keyboard shortcuts

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