jwt

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(claims UserClaims, key string) (string, error)

func GetIdFromToken

func GetIdFromToken(tokenString string, key string) (int, error)

Types

type UserClaims

type UserClaims struct {
	Id int `json:"id"`
	jwt.RegisteredClaims
}

func NewUserClaims

func NewUserClaims(id int, lifeDuration time.Duration) UserClaims

func (*UserClaims) GetLifeDuration

func (uc *UserClaims) GetLifeDuration() time.Duration

Jump to

Keyboard shortcuts

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