Documentation ¶
Index ¶
- func New(size int) cache.Cache
- type LRUCache
- func (c *LRUCache) Clear()
- func (c *LRUCache) ContainsKey(key interface{}) bool
- func (c *LRUCache) Get(key interface{}) interface{}
- func (c *LRUCache) KeySet() []interface{}
- func (c *LRUCache) Put(key, value interface{})
- func (c *LRUCache) PutIfAbsent(key, value interface{}) interface{}
- func (c *LRUCache) Remove(key interface{})
- func (c *LRUCache) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LRUCache ¶
type LRUCache struct {
Cache *lru.Cache
}
func (*LRUCache) ContainsKey ¶
func (*LRUCache) Put ¶
func (c *LRUCache) Put(key, value interface{})
Put value in cache, it doesn't have guarantee of concurrency treat
func (*LRUCache) PutIfAbsent ¶
func (c *LRUCache) PutIfAbsent(key, value interface{}) interface{}
Check if value is already associated, if yes just return it, if not put the passed value and return nil This method must be thread safe (atomic)
Click to show internal directories.
Click to hide internal directories.