jwt

package
v0.0.0-...-a9e947c Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: MIT, Zlib Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service represents a service for managing JWT tokens.

func NewService

func NewService() (*Service, error)

NewService initializes a new service. It will generate a random key that will be used to sign JWT tokens.

func (*Service) GenerateToken

func (service *Service) GenerateToken(data *whale.TokenData) (string, error)

GenerateToken generates a new JWT token.

func (*Service) ParseAndVerifyToken

func (service *Service) ParseAndVerifyToken(token string) (*whale.TokenData, error)

ParseAndVerifyToken parses a JWT token and verify its validity. It returns an error if token is invalid.

Jump to

Keyboard shortcuts

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