Versions in this module Expand all Collapse all v1 v1.1.7 Apr 1, 2021 Changes in this version + type EvictCallback func(key interface{}, value interface{}) + type LRU struct + func NewLRU(size int, onEvict EvictCallback) (*LRU, error) + func (c *LRU) Add(key, value interface{}) (evicted bool) + func (c *LRU) Contains(key interface{}) (ok bool) + func (c *LRU) Get(key interface{}) (value interface{}, ok bool) + func (c *LRU) GetOldest() (key interface{}, 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 interface{}, value interface{}, ok bool) + func (c *LRU) Resize(size int) (evicted int) + type LRUCache interface + Add func(key, value interface{}) bool + 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