token

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 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)

Register service implementor.

Types

type Token

type Token interface {
	// Generate 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)
	// Parse raw token string.
	ParseRaw(token string) (*secret.Info, error)
}

Token interface.

func Implementor

func Implementor() Token

Return the service implementor.

Jump to

Keyboard shortcuts

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