token

package
v1.117.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Unlicense Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterGenerator added in v1.117.0

func RegisterGenerator(kind string, g Generator)

RegisterGenerator for token.

func RegisterVerifier added in v1.117.0

func RegisterVerifier(kind string, v Verifier)

RegisterVerifier for token.

Types

type Config added in v1.117.0

type Config struct {
	Kind string `yaml:"kind" json:"kind" toml:"kind"`
}

Config for token.

func (*Config) Generator added in v1.117.0

func (c *Config) Generator() Generator

Generator for token.

func (*Config) Verifier added in v1.117.0

func (c *Config) Verifier() Verifier

Verifier for token.

type Generator

type Generator interface {
	// Generate a new token or error.
	Generate(ctx context.Context) (context.Context, []byte, error)
}

Generator allows the implementation of different types generators.

func NewGenerator added in v1.117.0

func NewGenerator() Generator

NewGenerator for token.

type Verifier

type Verifier interface {
	// Verify a token or error.
	Verify(ctx context.Context, token []byte) (context.Context, error)
}

Verifier allows the implementation of different types of verifiers.

func NewVerifier added in v1.117.0

func NewVerifier() Verifier

NewVerifier for token.

Jump to

Keyboard shortcuts

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