models

package
v0.0.0-...-8cfa0df Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type CustomClaims

type CustomClaims struct {
	ID string
	jwt.StandardClaims
}

type JWT

type JWT struct {
	SignKey []byte
}

func NewJwt

func NewJwt() *JWT

NewJwt create a JWT object

func (*JWT) CreateToken

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

CreateToken create a token

func (*JWT) ParseToken

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

ParseToken parse token

func (*JWT) RefreshToken

func (j *JWT) RefreshToken(tokenString string) (string, error)

ParseToken refresh Token

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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