Versions in this module Expand all Collapse all v1 v1.2.1 Mar 9, 2023 v1.2.0 Mar 8, 2023 v1.1.0 Mar 8, 2023 Changes in this version type Cache + func (c *Cache) Back() interface{} + func (c *Cache) Front() interface{} type Collection + Back func() *Entry + Front func() *Entry v1.0.5 Jun 27, 2022 Changes in this version type Cache + func (c *Cache) GC() time.Duration + func (c *Cache) Ignore(ch chan<- Event, ops ...Op) + func (c *Cache) Notify(ch chan<- Event, ops ...Op) + type Event struct + Expiry time.Time + Key interface{} + Ok bool + Op Op + Value interface{} + func (e Event) String() string + type Op uint8 + const Read + const Remove + const Write + func (op Op) String() string v1.0.4 Jun 17, 2022 v1.0.3 Jun 17, 2022 v1.0.2 Jun 17, 2022 v1.0.1 Jun 17, 2022 v1.0.0 Oct 16, 2020 Changes in this version + type Cache struct + func New(c Collection, cap int) *Cache + func (c *Cache) Cap() int + func (c *Cache) Contains(key interface{}) (ok bool) + func (c *Cache) DelSilently(key interface{}) + func (c *Cache) Delete(key interface{}) + func (c *Cache) Discard() (key, value interface{}) + func (c *Cache) Expiry(key interface{}) (t time.Time, ok bool) + func (c *Cache) Keys() (keys []interface{}) + func (c *Cache) Len() int + func (c *Cache) Load(key interface{}) (interface{}, bool) + func (c *Cache) Peek(key interface{}) (interface{}, bool) + func (c *Cache) Purge() + func (c *Cache) RegisterOnEvicted(f func(key, value interface{})) + func (c *Cache) RegisterOnExpired(f func(key, value interface{})) + func (c *Cache) Resize(size int) int + func (c *Cache) SetTTL(ttl time.Duration) + func (c *Cache) Store(key, value interface{}) + func (c *Cache) StoreWithTTL(key, value interface{}, ttl time.Duration) + func (c *Cache) TTL() time.Duration + func (c *Cache) Update(key, value interface{}) + type Collection interface + Add func(*Entry) + Discard func() *Entry + Init func() + Len func() int + Move func(*Entry) + Remove func(*Entry) + type Entry struct + Element interface{} + Exp time.Time + Key interface{} + Value interface{}