Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LruCache ¶
type LruCache[K comparable, V any] struct { // contains filtered or unexported fields }
func NewLruCache ¶
func NewLruCache[K comparable, V any](itemLimit uint32) *LruCache[K, V]
func (*LruCache[K, V]) Set ¶
Set adds a value to the cache with an optional lifetime. If adding this item would exceed the item limit, the least recently used item is evicted. If lifetime is greater than 0, the item is deleted after the lifetime. Otherwise, if lifetime is 0, the item is not going to be expired.
Click to show internal directories.
Click to hide internal directories.