mem

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenStore

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

TokenStore implements TokenStore completely in memory and uses an LRU cache to limit memory usage

func New

func New(size int, ttl time.Duration) *TokenStore

New returns a new TokenStore with the given cache size (item count) and item ttl

func (*TokenStore) Authenticate

func (t *TokenStore) Authenticate(token string) (identifier string, err error)

Authenticate authenticates the token and returns the associated identifier

func (*TokenStore) New

func (t *TokenStore) New(identifier string) (token string, err error)

New generates a new token identifier

Jump to

Keyboard shortcuts

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