Versions in this module Expand all Collapse all v0 v0.6.0 Dec 7, 2020 Changes in this version + type EvictCallback func(key interface{}, value interface{}) + type ExpirableLRU struct + func NewExpirableLRU(size int, onEvict EvictCallback, ttl, purgeEvery time.Duration) *ExpirableLRU + func (c *ExpirableLRU) Add(key, value interface{}) (evicted bool) + func (c *ExpirableLRU) Close() + func (c *ExpirableLRU) Contains(key interface{}) (ok bool) + func (c *ExpirableLRU) DeleteExpired() + func (c *ExpirableLRU) Get(key interface{}) (interface{}, bool) + func (c *ExpirableLRU) GetOldest() (key, value interface{}, ok bool) + func (c *ExpirableLRU) Keys() []interface{} + func (c *ExpirableLRU) Len() int + func (c *ExpirableLRU) Peek(key interface{}) (interface{}, bool) + func (c *ExpirableLRU) Purge() + func (c *ExpirableLRU) Remove(key interface{}) bool + func (c *ExpirableLRU) RemoveOldest() (key, value interface{}, ok bool) + func (c *ExpirableLRU) Resize(size int) (evicted int) + type LRU struct + func NewLRU(size int, onEvict EvictCallback) (*LRU, error) + func (c *LRU) Add(key, value interface{}) (evicted bool) + func (c *LRU) Close() + func (c *LRU) Contains(key interface{}) (ok bool) + func (c *LRU) Get(key interface{}) (value interface{}, ok bool) + func (c *LRU) GetOldest() (key, value interface{}, ok bool) + func (c *LRU) Keys() []interface{} + func (c *LRU) Len() int + func (c *LRU) Peek(key interface{}) (value interface{}, ok bool) + func (c *LRU) Purge() + func (c *LRU) Remove(key interface{}) (present bool) + func (c *LRU) RemoveOldest() (key, value interface{}, ok bool) + func (c *LRU) Resize(size int) (evicted int) + type LRUCache interface + Add func(key, value interface{}) bool + Close func() + Contains func(key interface{}) (ok bool) + Get func(key interface{}) (value interface{}, ok bool) + GetOldest func() (interface{}, interface{}, bool) + Keys func() []interface{} + Len func() int + Peek func(key interface{}) (value interface{}, ok bool) + Purge func() + Remove func(key interface{}) bool + RemoveOldest func() (interface{}, interface{}, bool) + Resize func(int) int Other modules containing this package github.com/paskal/golang-lru/v2