Versions in this module Expand all Collapse all v1 v1.0.0 Oct 16, 2017 Changes in this version + var DefaultCacheType = LRUCache + type Cache interface + Elems func() []*Item + Get func(key uint64) (interface{}, bool) + Len func() int + Peek func(key uint64) (interface{}, bool) + Put func(key uint64, value interface{}) + Remove func(key uint64) + func NewCache(size int, cacheType Type) Cache + func NewDefaultCache(size int) Cache + type FIFO struct + func NewFIFO(maxCount int) *FIFO + func (c *FIFO) Elems() []*Item + func (c *FIFO) FromElems(key uint64) []*Item + func (c *FIFO) Len() int + func (c *FIFO) Put(key uint64, value interface{}) + func (c *FIFO) Remove() + type Item struct + Key uint64 + Value interface{} + type LRU struct + func (c *LRU) Elems() []*Item + func (c *LRU) Get(key uint64) (interface{}, bool) + func (c *LRU) Len() int + func (c *LRU) Peek(key uint64) (interface{}, bool) + func (c *LRU) Put(key uint64, value interface{}) + func (c *LRU) Remove(key uint64) + type TTL struct + func NewTTL(gcInterval time.Duration, ttl time.Duration) *TTL + func (c *TTL) Get(key uint64) (interface{}, bool) + func (c *TTL) Len() int + func (c *TTL) Put(key uint64, value interface{}) + func (c *TTL) PutWithTTL(key uint64, value interface{}, ttl time.Duration) + func (c *TTL) Remove(key uint64) + type TTLUint64 struct + func NewIDTTL(gcInterval, ttl time.Duration) *TTLUint64 + func (c *TTLUint64) Exists(id uint64) bool + func (c *TTLUint64) Put(id uint64) + type TwoQueue struct + func (c *TwoQueue) Elems() []*Item + func (c *TwoQueue) Get(key uint64) (interface{}, bool) + func (c *TwoQueue) Len() int + func (c *TwoQueue) Peek(key uint64) (interface{}, bool) + func (c *TwoQueue) Put(key uint64, value interface{}) + func (c *TwoQueue) Remove(key uint64) + type Type int + const LRUCache + const TwoQueueCache