Versions in this module Expand all Collapse all v0 v0.0.1 Mar 8, 2023 Changes in this version + type EvictCallback func(key interface{}, value interface{}) + type LRU struct + func NewLRU(size int, onEvict EvictCallback) (*LRU, error) + func NewLRUWithExpire(size int, expire time.Duration, onEvict EvictCallback) (*LRU, error) + func (c *LRU) Add(key, value interface{}) bool + func (c *LRU) AddEx(key, value interface{}, expire time.Duration) bool + func (c *LRU) Contains(key interface{}) (ok bool) + func (c *LRU) Get(key interface{}) (value interface{}, ok bool) + func (c *LRU) GetOldest() (interface{}, interface{}, bool) + func (c *LRU) Keys() []interface{} + func (c *LRU) Len() int + func (c *LRU) Peek(key interface{}) (value interface{}, ok bool) + func (c *LRU) PeekWithExpireTime(key interface{}) (value interface{}, expire *time.Time, ok bool) + func (c *LRU) Purge() + func (c *LRU) Remove(key interface{}) bool + func (c *LRU) RemoveOldest() (interface{}, interface{}, bool) + func (c *LRU) Resize(size int) int