Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // Get returns the cache value associated with key Get(key interface{}) (interface{}, bool) // Put puts a value in cache associated with key Put(key interface{}, value interface{}) // Delete deletes the cache entry associated with key Delete(key interface{}) // ToMap returns the current cache entries copied into a map ToMap() map[interface{}]interface{} }
Cache represents a key-value storage where to put cached data.
type LRUCache ¶
type LRUCache struct {
// contains filtered or unexported fields
}
LRUCache is a Least Recently Used (LRU) Cache with given capacity.
func NewLRUCache ¶
NewLRUCache creates a new Least Recently Used (LRU) Cache.
func (*LRUCache) Delete ¶
func (c *LRUCache) Delete(key interface{})
Delete deletes the cache entry associated with key.
type MapCache ¶
type MapCache struct {
// contains filtered or unexported fields
}
MapCache is a cache backed by a map.
func (*MapCache) Delete ¶
func (c *MapCache) Delete(key interface{})
Delete deletes the cache entry associated with key.
Click to show internal directories.
Click to hide internal directories.