jwt

package
v0.0.0-...-f679f10 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const PublicKeyUser = "___public__key_user"

Variables

View Source
var ErrInvalidToken = errors.New("invalid token")
View Source
var (
	ErrJWTExpired = errors.New("token expired")
)

Functions

This section is empty.

Types

type Claim

type Claim struct {
	PublicKey string
	jwt.RegisteredClaims
}

Claim adds email as a claim to the token

type DecodeJWTClaims

type DecodeJWTClaims struct {
	ExpiredAt float64 `json:"expiredAt"`
	UID       string  `json:"uid"`
}

type JWT

type JWT interface {
	GenerateToken(publicKey string) (string, error)
	ValidateToken(token string) (*Claim, error)
}

func New

func New(secret, issuer string, expiry int64) JWT

type Token

type Token struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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