Middlewares

package
v0.0.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TokenExpired     = errors.New("Token is expired")
	TokenNotValidYet = errors.New("Token not active yet")
	TokenMalformed   = errors.New("That's not even a token")
	TokenInvalid     = errors.New("Couldn't handle this token:")
)

Functions

func JWTAuth

func JWTAuth() gin.HandlerFunc

JWTAuth 简易的jwt认证

Types

type JWT added in v0.0.4

type JWT struct {
	SigningKey []byte
}

func NewJWT added in v0.0.4

func NewJWT() *JWT

func (*JWT) CreateToken added in v0.0.4

func (j *JWT) CreateToken(claims request.CustomClaims) (string, error)

创建一个token

func (*JWT) ParseToken added in v0.0.4

func (j *JWT) ParseToken(tokenString string) (*request.CustomClaims, error)

解析 token

Jump to

Keyboard shortcuts

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