tokens

package
v0.0.0-...-4315425 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTokenCreator

func NewTokenCreator(tokenTTL time.Duration, store tokencache.TokenCache, generator Generator) *tokenCreator

func NewTokenCreatorProvider

func NewTokenCreatorProvider(store tokencache.TokenCache, generator Generator) *tokenCreatorProvider

func NewTokenManager

func NewTokenManager(store tokencache.TokenCache) *tokenManager

Types

type Creator

type Creator interface {
	Save(interface{}) (string, apperrors.AppError)
}

type Generator

type Generator func() (string, apperrors.AppError)

type Manager

type Manager interface {
	Resolve(token string, destination interface{}) apperrors.AppError
	Delete(token string)
}

type Serializer

type Serializer interface {
	ToJSON() ([]byte, error)
}

type TokenCreatorProvider

type TokenCreatorProvider interface {
	WithTTL(ttl time.Duration) Creator
}

type TokenGenerator

type TokenGenerator interface {
	NewToken() (string, apperrors.AppError)
}

func NewTokenGenerator

func NewTokenGenerator(tokenLength int) TokenGenerator

Directories

Path Synopsis
Code generated by mockery v1.0.0.
Code generated by mockery v1.0.0.

Jump to

Keyboard shortcuts

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