mint

package
v0.0.0-...-39d70b0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Minter

type Minter interface {
	Mint(v any) Token
}

func NewMinter

func NewMinter(secret []byte) Minter

type MinterFunc

type MinterFunc func(v any) Token

func (MinterFunc) Mint

func (fn MinterFunc) Mint(v any) Token

type Secret

type Secret []byte

func NewSecret

func NewSecret(length int) Secret

func (Secret) B64

func (s Secret) B64() string

func (Secret) Hex

func (s Secret) Hex() string

func (Secret) String

func (s Secret) String() string

type Token

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

func NewToken

func NewToken(secret []byte, payload any) Token

func ParseToken

func ParseToken(v string) (Token, error)

func (Token) Into

func (t Token) Into(p any) error

func (Token) IsValid

func (t Token) IsValid(key []byte) bool

func (Token) String

func (t Token) String() string

Jump to

Keyboard shortcuts

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