token

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PrivatePem string        `koanf:"private_pem"`
	PublicPem  string        `koanf:"public_pem"`
	Expiration time.Duration `koanf:"expiration"`
}

type Payload

type Payload struct {
	Data []byte `json:"data"`
	jwt.RegisteredClaims
}

type Token

type Token interface {
	CreateTokenString(data any) (string, error)
	ExtractTokenData(tokenString string, data any) error
}

func New

func New(cfg *Config) (Token, error)

Jump to

Keyboard shortcuts

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