Documentation ¶
Overview ¶
Package lru implements an LRU cache.
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
}
Cache is an LRU cache, safe for concurrent access.
func (*Cache) Add ¶
Add adds the provided key and value to the cache, evicting an old item if necessary.
func (*Cache) Get ¶
Get fetches the key's value from the cache. The ok result will be true if the item was found.
func (*Cache) RemoveOldest ¶
func (c *Cache) RemoveOldest()
RemoveOldest removes the oldest item in the cache.
Click to show internal directories.
Click to hide internal directories.