Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // Insert inserts the given key and value into the cache Insert(key, value interface{}) bool // Get looks up and returns the given key and value from the cache. The second // argument indicates whether the key was indeed found. Get(key interface{}) (interface{}, bool) // Delete deletes the given key from the cache and returns the deleted value. // The second argument indicates whether the key was found in the cache. Delete(key interface{}) (interface{}, bool) // Evict evicts the least recently used element from the cache. The second // argument indicates whether there was an element to remove or not. Evict() (interface{}, bool) // Len returns the current number of items in the cache Len() int // Size returns the maximum size of the cache Size() int }
Cache implements an LRU cache
Click to show internal directories.
Click to hide internal directories.