Documentation ¶
Index ¶
Constants ¶
View Source
const KeyLength = 16
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // Insert the given value into the cache. The value must not be the nil // interface, and its type must have been previously registered using // gob.Register. Insert(key Key, value interface{}) // Look up a previously-inserted value fo the given key. Return nil if no // value is present. LookUp(key Key) interface{} }
A cache mapping from string keys to arbitrary values. Safe for concurrent access, and supports gob encoding.
func NewLruCache ¶
Create a cache that holds the given number of items, evicting the least recently used item when more space is needed.
Click to show internal directories.
Click to hide internal directories.