Discover Packages
deps.dev/util/resolve
pypi
internal
lru
package
Version:
v0.0.0-...-5c6b87f
Opens a new window with list of versions in this module.
Published: Aug 24, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
package lru provides a generic least-recently-used cache.
Cache implements an LRU cache, with a particular maximum size.
func (c *Cache [K, V]) Add(k K, v V)
Add inserts an element into the cache, removing an element if necessary to
keep the size fixed. If the key is already present its value is updated.
func (c *Cache [K, V]) Get(k K) (v V, ok bool )
Get returns the value associated with the given key from the cache, as well
as a boolean indicating whether the key was found.
It also moves the accessed item to the front of the LRU list, indicating it
was recently used.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.