Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
// Adds node to cache.
// Returns true of eviction occurred, false otherwise.
// CONTRACT: node can never be nil. Otherwise, cache panics.
Add(node Node) bool
// Returns Node for the key, if exists. nil otherwise.
Get(key []byte) Node
// Has returns true if node with key exists in cache, false otherwise.
Has(key []byte) bool
// Remove removes node with key from cache.
// Returns true if removal occurred, false otherwise.
Remove(key []byte) bool
// Len returns the cache length.
Len() int
}
Cache is an in-memory structure to persist nodes for quick access. Please see lruCache for more details about why we need a custom cache implementation.
Click to show internal directories.
Click to hide internal directories.