Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LRUCache ¶ added in v0.1.13
type LRUCache interface { // Add adds a value to the cache. Add(key Key, value interface{}) // Get looks up a key's value from the cache. Get(key Key) (interface{}, bool) // Remove removes the provided key from the cache. Remove(key Key) // RemoveOldest removes the oldest item from the cache. RemoveOldest() // Len returns the number of items in the cache. Len() int // Clear purges all stored items from the cache. Clear() // Range call f on every key Range(f func(key Key, value interface{}) bool) }
func NewDummyLruCache ¶ added in v0.1.13
func NewDummyLruCache() LRUCache
NewDummyLruCache returns a dummy lru cache
func NewThreadSafeLruCache ¶
NewThreadSafeLruCache returns a thread safe lru cache with fix size
func NewThreadSafeLruCacheWithOnEvicted ¶ added in v0.1.5
func NewThreadSafeLruCacheWithOnEvicted(maxEntries int, onEvicted func(key Key, value interface{})) LRUCache
NewThreadSafeLruCacheWithOnEvicted returns a thread safe lru cache with fix size
Click to show internal directories.
Click to hide internal directories.