Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[T any] struct { // contains filtered or unexported fields }
Cache is a generic lru cache that allows you to lookup values using a key and a version. By design, this cache allows access to only a single version of a given key. A version mismatch is considered a cache miss and the key gets evicted if it exists. When a key is evicted a optional cleanup function is called.
func Must ¶
Must creates a new lru cache with the desired size and cleanup func This function panics if a error occurrs.
Click to show internal directories.
Click to hide internal directories.