Versions in this module Expand all Collapse all v0 v0.1.0 Mar 12, 2021 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 TTLString struct + func NewStringTTL(ctx context.Context, gcInterval, ttl time.Duration) *TTLString + func (c *TTLString) Get(id string) (interface{}, bool) + func (c *TTLString) Pop() (string, interface{}, bool) + func (c *TTLString) Put(key string, value interface{}) + func (c *TTLString) PutWithTTL(key string, value interface{}, ttl time.Duration) + func (c TTLString) Clear() + func (c TTLString) Len() int + type TTLUint64 struct + func NewIDTTL(ctx context.Context, gcInterval, ttl time.Duration) *TTLUint64 + func (c *TTLUint64) Exists(id uint64) bool + func (c *TTLUint64) Get(id uint64) (interface{}, bool) + func (c *TTLUint64) GetAllID() []uint64 + func (c *TTLUint64) Put(id uint64, value interface{}) + func (c *TTLUint64) PutWithTTL(key uint64, value interface{}, ttl time.Duration) + func (c *TTLUint64) Remove(key uint64) + func (c TTLUint64) Clear() + func (c TTLUint64) Len() int + 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