jwt

package
v0.0.0-...-ee83092 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Expired = errors.New("token expired")
	Invalid = errors.New("token is invalid")
)

Functions

func GenerateToken

func GenerateToken(name, lastname, email string, expirationTime time.Duration, privateKey string) (string, error)

func VerifyToken

func VerifyToken(token string, pubKey string) (*jwt.Token, error)

Types

type Claims

type Claims struct {
	Email    string `json:"email,omitempty"`
	Name     string `json:"name,omitempty"`
	LastName string `json:"lastname,omitempty"`
	jwt.StandardClaims
}

func NewClaims

func NewClaims(name, lastname, email string, expiration time.Duration) *Claims

Jump to

Keyboard shortcuts

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