cache

package
v0.0.0-...-988e9ee Latest Latest
Warning

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

Go to latest
Published: Apr 3, 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 Cache

type Cache interface {
	// SetSize sets the size of the internal cache
	SetSize(size int)

	// Evict evicts a particular key from the cache
	Evict(id string)

	// Clear clears the internal cache
	Clear()
}

type TokenCache

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

func NewTokenCache

func NewTokenCache(supplier database.Controller[*types.Token], cacheSize int) *TokenCache

func (*TokenCache) Clear

func (t *TokenCache) Clear()

func (*TokenCache) Count

func (t *TokenCache) Count(ctx context.Context) (int64, error)

func (*TokenCache) Delete

func (t *TokenCache) Delete(ctx context.Context, id string) error

func (*TokenCache) Evict

func (t *TokenCache) Evict(id string)

func (*TokenCache) Find

func (*TokenCache) Get

func (t *TokenCache) Get(ctx context.Context, id string) (*types.Token, error)

func (*TokenCache) Insert

func (t *TokenCache) Insert(ctx context.Context, token *types.Token) error

func (*TokenCache) SetSize

func (t *TokenCache) SetSize(size int)

func (*TokenCache) Update

func (t *TokenCache) Update(ctx context.Context, id string, updates updates.Updates[*types.Token]) error

Jump to

Keyboard shortcuts

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