jwt

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidToken = jwt.ErrTokenInvalidId
	ExpiredToken = jwt.ErrTokenExpired
)

Functions

func NewJwtToken

func NewJwtToken(secretKey string, iat, seconds int64, opt ...Option) (string, error)

NewJwtToken Generate and return jwt token with given data.

func ParseJwtToken

func ParseJwtToken(tokenString, secretKey string) (jwt.MapClaims, error)

ParseJwtToken Parse jwt token and return claims.

func VerifyToken

func VerifyToken(tokenString, secret string) error

Types

type Option

type Option struct {
	Key string
	Val any
}

Option jwt additional data

func WithOption

func WithOption(key string, val any) Option

WithOption returns Option with key-value pairs

Jump to

Keyboard shortcuts

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