Versions in this module Expand all Collapse all v1 v1.0.0 Nov 12, 2023 Changes in this version + type EvictCallback func(key K, value V) + type LruCache struct + func New[K comparable, V any](options ...Option[K, V]) *LruCache[K, V] + func (c *LruCache[K, V]) Clear() error + func (c *LruCache[K, V]) CloneTo(n *LruCache[K, V]) + func (c *LruCache[K, V]) Delete(key K) + func (c *LruCache[K, V]) Exist(key K) bool + func (c *LruCache[K, V]) Get(key K) (V, bool) + func (c *LruCache[K, V]) GetOrStore(key K, constructor func() V) (V, bool) + func (c *LruCache[K, V]) GetWithExpire(key K) (V, time.Time, bool) + func (c *LruCache[K, V]) Set(key K, value V) + func (c *LruCache[K, V]) SetWithExpire(key K, value V, expires time.Time) + type Option func(*LruCache[K, V]) + func WithAge[K comparable, V any](maxAge int64) Option[K, V] + func WithEvict[K comparable, V any](cb EvictCallback[K, V]) Option[K, V] + func WithSize[K comparable, V any](maxSize int) Option[K, V] + func WithStale[K comparable, V any](stale bool) Option[K, V] + func WithUpdateAgeOnGet[K comparable, V any]() Option[K, V]