Documentation
¶
Overview ¶
Package lru implements asynchronous LRU cache.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[K comparable, V any] struct { // contains filtered or unexported fields }
Cache is a LRU cache.
func NewCache ¶
func NewCache[K comparable, V any](capacity int, f func(K) (V, error)) *Cache[K, V]
NewCache creates an LRU cache with the specified capacity; f - function to get value by key, which is called if there is no value in the cache
Click to show internal directories.
Click to hide internal directories.