Versions in this module Expand all Collapse all v1 v1.1.7 Apr 1, 2021 Changes in this version + const Default2QGhostEntries + const Default2QRecentRatio + type ARCCache struct + func NewARC(size int) (*ARCCache, error) + func (c *ARCCache) Add(key, value interface{}) + func (c *ARCCache) Contains(key interface{}) bool + func (c *ARCCache) Get(key interface{}) (value interface{}, ok bool) + func (c *ARCCache) Keys() []interface{} + func (c *ARCCache) Len() int + func (c *ARCCache) Peek(key interface{}) (value interface{}, ok bool) + func (c *ARCCache) Purge() + func (c *ARCCache) Remove(key interface{}) + type Cache struct + func New(size int) (*Cache, error) + func NewWithEvict(size int, onEvicted func(key interface{}, value interface{})) (*Cache, error) + func (c *Cache) Add(key, value interface{}) (evicted bool) + func (c *Cache) Contains(key interface{}) bool + func (c *Cache) ContainsOrAdd(key, value interface{}) (ok, evicted bool) + func (c *Cache) Get(key interface{}) (value interface{}, ok bool) + func (c *Cache) GetOldest() (key interface{}, value interface{}, ok bool) + func (c *Cache) Keys() []interface{} + func (c *Cache) Len() int + func (c *Cache) Peek(key interface{}) (value interface{}, ok bool) + func (c *Cache) PeekOrAdd(key, value interface{}) (previous interface{}, ok, evicted bool) + func (c *Cache) Purge() + func (c *Cache) Remove(key interface{}) (present bool) + func (c *Cache) RemoveOldest() (key interface{}, value interface{}, ok bool) + func (c *Cache) Resize(size int) (evicted int) + type TwoQueueCache struct + func New2Q(size int) (*TwoQueueCache, error) + func New2QParams(size int, recentRatio float64, ghostRatio float64) (*TwoQueueCache, error) + func (c *TwoQueueCache) Add(key, value interface{}) + func (c *TwoQueueCache) Contains(key interface{}) bool + func (c *TwoQueueCache) Get(key interface{}) (value interface{}, ok bool) + func (c *TwoQueueCache) Keys() []interface{} + func (c *TwoQueueCache) Len() int + func (c *TwoQueueCache) Peek(key interface{}) (value interface{}, ok bool) + func (c *TwoQueueCache) Purge() + func (c *TwoQueueCache) Remove(key interface{})