Versions in this module Expand all Collapse all v1 v1.0.0 Jul 12, 2020 Changes in this version + type Cache struct + func NewExpirableLRU(size int, onEvict EvictCallback, ttl, purgeEvery time.Duration) *Cache + func (c *Cache) Add(key, value interface{}) (evicted bool) + func (c *Cache) AddWithTTL(key, value interface{}, ttl time.Duration) (evicted bool) + func (c *Cache) Close() + func (c *Cache) Contains(key interface{}) (ok bool) + func (c *Cache) DeleteExpired() + func (c *Cache) Get(key interface{}) (interface{}, bool) + func (c *Cache) GetOldest() (key, value interface{}, ok bool) + func (c *Cache) Keys() []interface{} + func (c *Cache) Len() int + func (c *Cache) Peek(key interface{}) (interface{}, bool) + func (c *Cache) Purge() + func (c *Cache) Remove(key interface{}) bool + func (c *Cache) RemoveOldest() (key, value interface{}, ok bool) + func (c *Cache) Resize(size int) (evicted int) + type EvictCallback func(key interface{}, value interface{})