Documentation
¶
Overview ¶
This file implements a no-op cache that always misses and never stores values. NoCache is useful for testing or when caching should be disabled without changing code.
This file implements a high-performance cache using Ristretto v2. It provides thread-safe caching with singleflight to prevent duplicate loads.
Index ¶
Constants ¶
View Source
const ( // ZeroCost with this ristretto uses the Cost function defined in its configuration ZeroCost = 0 // Default Ristretto configuration values DefaultNumCounters = 1e6 // 1 million DefaultMaxCost = 1e8 // 100 million DefaultBufferItems = 64 )
Variables ¶
This section is empty.
Functions ¶
func NewRistrettoCache ¶
NewRistrettoCache creates and returns a new ristretto-based cache implementation.
func NewRistrettoCacheWithSize ¶ added in v0.10.0
Types ¶
Click to show internal directories.
Click to hide internal directories.