Versions in this module Expand all Collapse all v1 v1.101106.0 Jul 11, 2023 Changes in this version + type BasicLRU struct + func NewBasicLRU(capacity int) BasicLRU[K, V] + func (c *BasicLRU[K, V]) Add(key K, value V) (evicted bool) + func (c *BasicLRU[K, V]) Contains(key K) bool + func (c *BasicLRU[K, V]) Get(key K) (value V, ok bool) + func (c *BasicLRU[K, V]) GetOldest() (key K, value V, ok bool) + func (c *BasicLRU[K, V]) Keys() []K + func (c *BasicLRU[K, V]) Len() int + func (c *BasicLRU[K, V]) Peek(key K) (value V, ok bool) + func (c *BasicLRU[K, V]) Purge() + func (c *BasicLRU[K, V]) Remove(key K) bool + func (c *BasicLRU[K, V]) RemoveOldest() (key K, value V, ok bool) + type Cache struct + func NewCache(capacity int) *Cache[K, V] + func (c *Cache[K, V]) Add(key K, value V) (evicted bool) + func (c *Cache[K, V]) Contains(key K) bool + func (c *Cache[K, V]) Get(key K) (value V, ok bool) + func (c *Cache[K, V]) Keys() []K + func (c *Cache[K, V]) Len() int + func (c *Cache[K, V]) Peek(key K) (value V, ok bool) + func (c *Cache[K, V]) Purge() + func (c *Cache[K, V]) Remove(key K) bool + type SizeConstrainedCache struct + func NewSizeConstrainedCache(maxSize uint64) *SizeConstrainedCache[K, V] + func (c *SizeConstrainedCache[K, V]) Add(key K, value V) (evicted bool) + func (c *SizeConstrainedCache[K, V]) Get(key K) (V, bool)