jwt

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnexpectedSigningMethod = errors.New("unexpected signing method")

ErrUnexpectedSigningMethod is returned when the JWT signing method is not expected.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles JWT token generation and parsing.

func New

func New(secret string, duration time.Duration) *Manager

New -.

func (*Manager) GenerateToken

func (m *Manager) GenerateToken(userID string) (string, error)

GenerateToken creates a new JWT token for the given user ID.

func (*Manager) ParseToken

func (m *Manager) ParseToken(tokenString string) (string, error)

ParseToken validates a JWT token and returns the user ID.

Jump to

Keyboard shortcuts

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