cache

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 3 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 {
	// EvictShortLiving - notify the cache that all short living elements cached before the events should be considered as evicted.
	EvictShortLiving()

	// IsEvicted - based on the eviction event and the time of caching, calculates whether the key was evicted
	IsEvicted(key any, originalTTL time.Duration) bool

	Set(key []byte, value any, ttl time.Duration) bool
	Get(key []byte) (value any, ok bool)
	Remove(key []byte)
}

func NewCache

func NewCache(logger log.Logger) (Cache, error)

func NewRistrettoCacheWithEviction added in v0.24.0

func NewRistrettoCacheWithEviction(logger log.Logger) (Cache, error)

NewRistrettoCacheWithEviction returns a new ristrettoCache.

Jump to

Keyboard shortcuts

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