token

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterImplementor

func RegisterImplementor(token Token)

RegisterImplementor registers the token service implementor.

Types

type Token

type Token interface {
	// NewSecretKey creates a new secret key.
	NewSecretKey(alg secret.Algorithm) ([]byte, error)
	// Generate a new token with specified secret info.
	Generate(s *secret.Info) (string, error)
	// Refresh the token with expired time renewed.
	Refresh(s *secret.Info) (string, error)
	// Parse the metadata.
	Parse(md *common.Metadata) (*secret.Info, error)
	// ParseRaw parses a token string.
	ParseRaw(token string) (*secret.Info, error)
}

Token interface.

func Implementor

func Implementor() Token

Implementor return the token service implementor.

Jump to

Keyboard shortcuts

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