validator

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidToken = errors.New("invalid token")

Functions

This section is empty.

Types

type Storage

type Storage interface {
	FindToken(ctx context.Context, id dbo.KeyID) (*dbo.Token, error)
	UpdateTokensStats(ctx context.Context, stats []dbo.TokenStat) error
}

type Validator

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

func NewValidator

func NewValidator(storage Storage, cacheCapacity int, cacheTTL time.Duration) *Validator

func (*Validator) Invalidate

func (v *Validator) Invalidate(keyID dbo.KeyID)

func (*Validator) UpdateStats

func (v *Validator) UpdateStats(ctx context.Context) error

func (*Validator) Valid

func (v *Validator) Valid(ctx context.Context, path string, token string) (*dbo.Token, error)

Jump to

Keyboard shortcuts

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