middleware

package
v0.0.0-...-55e1567 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: GPL-3.0 Imports: 11 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")
	TokenNotFound    = errors.New("no token")
)

Functions

func JWTAuth

func JWTAuth(secretKey string) app.HandlerFunc

func Recovery

func Recovery() app.HandlerFunc

Types

type JWT

type JWT struct {
	SigningKey []byte
}

func NewJWT

func NewJWT(secretKey string) *JWT

func (*JWT) CreateToken

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

CreateToken to create a token

func (*JWT) ParseToken

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

ParseToken to parse a token

Jump to

Keyboard shortcuts

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