Versions in this module Expand all Collapse all v1 v1.15.1 Nov 7, 2019 Changes in this version + type Cache interface + CompareAndSwap func(key string, old, new interface{}) (interface{}, bool) + Delete func(key string) + Get func(key string) interface{} + Put func(key string, value interface{}) interface{} + Size func() int + type EvictCallback func(key string, value interface{}) + type LRU struct + TimeNow func() time.Time + func NewLRU(maxSize int) *LRU + func NewLRUWithOptions(maxSize int, opts *Options) *LRU + func (c *LRU) CompareAndSwap(key string, oldValue, newValue interface{}) (itemInCache interface{}, replaced bool) + func (c *LRU) Delete(key string) + func (c *LRU) Get(key string) interface{} + func (c *LRU) Put(key string, value interface{}) interface{} + func (c *LRU) Size() int + type Options struct + InitialCapacity int + OnEvict EvictCallback + TTL time.Duration + TimeNow func() time.Time