_jwt

package
v0.0.0-...-3b8fdc3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EXPIRE time.Duration
	SECRET string
)

Functions

This section is empty.

Types

type JwtClaims

type JwtClaims struct {
	ID       interface{} `json:"id"`
	Username string      `json:"username"`
	jwt.StandardClaims
}

func NewJwtInstance

func NewJwtInstance(expire time.Duration, secret string) *JwtClaims

func (*JwtClaims) GenerateToken

func (j *JwtClaims) GenerateToken(claims *JwtClaims) (string, error)

GenerateToken 签发Token

func (*JwtClaims) ParseToken

func (j *JwtClaims) ParseToken(token string) (*JwtClaims, error)

ParseToken 解析TOKEN

Jump to

Keyboard shortcuts

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