cache

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT 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 {
	Get(key string) (any, bool)
	Set(key string, value any, cost int64, ttl time.Duration) bool
	Del(key string)
}

type RistrettoCache

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

func NewRistrettoCache

func NewRistrettoCache(numCounters, maxCost int64, bufferItems int64) (*RistrettoCache, error)

func (*RistrettoCache) Del

func (r *RistrettoCache) Del(key string)

func (*RistrettoCache) Get

func (r *RistrettoCache) Get(key string) (any, bool)

func (*RistrettoCache) Set

func (r *RistrettoCache) Set(key string, value any, cost int64, ttl time.Duration) bool

func (*RistrettoCache) Wait

func (r *RistrettoCache) Wait()

Wait flushes pending sets (useful for tests determinism)

Jump to

Keyboard shortcuts

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