Versions in this module Expand all Collapse all v0 v0.2.0 Sep 11, 2018 Changes in this version type ARCCache + func (c *ARCCache) AddEx(key, value interface{}, expire time.Duration) type Cache + func (c *Cache) AddEx(key, value interface{}, expire time.Duration) bool type TwoQueueCache + func (c *TwoQueueCache) AddEx(key, value interface{}, expire time.Duration) v0.1.0 Apr 22, 2018 Changes in this version + const Default2QGhostEntries + const Default2QRecentRatio + type ARCCache struct + func NewARC(size int) (*ARCCache, error) + func NewARCWithExpire(size int, expire time.Duration) (*ARCCache, error) + func (c *ARCCache) Add(key, value interface{}) + func (c *ARCCache) Contains(key interface{}) bool + func (c *ARCCache) Get(key interface{}) (interface{}, bool) + func (c *ARCCache) Keys() []interface{} + func (c *ARCCache) Len() int + func (c *ARCCache) Peek(key interface{}) (interface{}, 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 NewWithExpire(size int, expire time.Duration) (*Cache, error) + func (c *Cache) Add(key, value interface{}) bool + func (c *Cache) Contains(key interface{}) bool + func (c *Cache) ContainsOrAdd(key, value interface{}) (ok, evict bool) + func (c *Cache) Get(key interface{}) (interface{}, 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{}) + func (c *Cache) RemoveOldest() + type TwoQueueCache struct + func New2Q(size int) (*TwoQueueCache, error) + func New2QParams(size int, recentRatio float64, ghostRatio float64) (*TwoQueueCache, error) + func New2QParamsWithExpire(size int, expire time.Duration, recentRatio float64, ghostRatio float64) (*TwoQueueCache, error) + func New2QWithExpire(size int, expire time.Duration) (*TwoQueueCache, error) + func (c *TwoQueueCache) Add(key, value interface{}) + func (c *TwoQueueCache) Contains(key interface{}) bool + func (c *TwoQueueCache) Get(key interface{}) (interface{}, bool) + func (c *TwoQueueCache) Keys() []interface{} + func (c *TwoQueueCache) Len() int + func (c *TwoQueueCache) Peek(key interface{}) (interface{}, bool) + func (c *TwoQueueCache) Purge() + func (c *TwoQueueCache) Remove(key interface{})