Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
badgerCache implements LRU cache using BadgerDB as high-performant, embedded k/v store.
type LRUCache ¶
type LRUCache interface { // Add caches value for key. If cache is full (not part of the // interface), oldest records are dropped to make room. Add(key, value []byte) // Get retrieves value corresponding to key from cache if present. // Returns false in second argument if no value found or any other // error. Get(key []byte) ([]byte, bool) // Len returns number of values currently cached. Len() int }
LRUCache defines operations on a standard LRU cache. All operations are meant to be thread-safe.
func NewLRUCache ¶
NewLRUCache returns new cache store.
Click to show internal directories.
Click to hide internal directories.