jwt

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

JwtAuth gin中间件验证jwt

Functions

func JwtAuth

func JwtAuth() gin.HandlerFunc

JwtAuth gin中间件验证jwt

Types

type CustomClaims

type CustomClaims struct {
	UserId int `json:"userId"`
	jwt.StandardClaims
}

type Jwt

type Jwt struct {
	SignKey []byte
}

func NewJwt

func NewJwt() *Jwt

func (*Jwt) CreateJwtToken

func (j *Jwt) CreateJwtToken(claims CustomClaims) (string, error)

CreateJwtToken 生成token

func (*Jwt) ParseJwtToken

func (j *Jwt) ParseJwtToken(tokenString string) (*CustomClaims, error)

ParseToken 解析token

func (*Jwt) RefreshJwtToken

func (j *Jwt) RefreshJwtToken(tokenString string) (string, error)

RefreshJwtToken 更新token

Jump to

Keyboard shortcuts

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