Documentation
¶
Overview ¶
Package container provides LRU cache implementation
Package container provides core container interfaces and implementations
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[K comparable, V any] interface { Put(K, V) Get(K) (V, bool) Delete(K) Len() int Evict(K) }
Cache interface for size-bounded storage
type LRUCache ¶
type LRUCache[K comparable, V any] struct { // contains filtered or unexported fields }
LRUCache implements least-recently-used cache
func NewLRUCache ¶
func NewLRUCache[K comparable, V any](size int) *LRUCache[K, V]
func NewLRUCacheWithOnEvict ¶
func NewLRUCacheWithOnEvict[K comparable, V any](size int, onEvict func(K, V)) *LRUCache[K, V]
Click to show internal directories.
Click to hide internal directories.