jwt

package module
v0.0.0-...-f55a6fa Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomClaims

type CustomClaims struct {
	UserID int `json:"name,omitempty"`
	jwt.StandardClaims
}

type Parser

type Parser struct {
	Secret []byte
}

func NewParser

func NewParser(secret []byte) *Parser

func (Parser) GenerateToken

func (p Parser) GenerateToken(userID int, exp time.Duration) (string, error)

func (Parser) IsTokenExpired

func (p Parser) IsTokenExpired(t string) bool

func (Parser) ParseToken

func (p Parser) ParseToken(t string) (CustomClaims, error)

Jump to

Keyboard shortcuts

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