Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrElementNotFound is returned when element isn't found in the cache. ErrElementNotFound = fmt.Errorf("unable to find element") )
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[K comparable, V Value] interface { // Put stores the given (key,value) pair, replacing existing value if // key already exists. The return value indicates whether items had to // be evicted to make room for the new element. Put(key K, value V) (bool, error) // Get returns the value for a given key. Get(key K) (V, error) // Len returns number of elements in the cache. Len() int }
Cache represents a generic cache.
Click to show internal directories.
Click to hide internal directories.