Versions in this module Expand all Collapse all v1 v1.11.13-rc.2 Dec 4, 2024 v1.0.0 Dec 4, 2024 Changes in this version + const TestIntSize + var CacherTests = []struct{ ... } + func TestBasic(t *testing.T, cache Cacher[ids.ID, int64]) + func TestEviction(t *testing.T, cache Cacher[ids.ID, int64]) + func TestIntSizeFunc(ids.ID, int64) int + type Cacher interface + Evict func(key K) + Flush func() + Get func(key K) (V, bool) + Len func() int + PortionFilled func() float64 + Put func(key K, value V) + func NewSizedLRU[K comparable, V any](maxSize int, size func(K, V) int) Cacher[K, V] + type Deduplicator interface + Deduplicate func(V) V + Flush func() + type Empty struct + func (*Empty[K, V]) Get(K) (V, bool) + func (*Empty[K, V]) Put(K, V) + func (*Empty[K, _]) Evict(K) + func (*Empty[_, _]) Flush() + func (*Empty[_, _]) Len() int + func (*Empty[_, _]) PortionFilled() float64 + type Evictable interface + Evict func() + Key func() K + type EvictableLRU struct + Size int + func (c *EvictableLRU[_, V]) Deduplicate(value V) V + func (c *EvictableLRU[_, _]) Flush() + type LRU struct + Size int + func (c *LRU[K, V]) Get(key K) (V, bool) + func (c *LRU[K, V]) Put(key K, value V) + func (c *LRU[K, _]) Evict(key K) + func (c *LRU[_, _]) Flush() + func (c *LRU[_, _]) Len() int + func (c *LRU[_, _]) PortionFilled() float64