Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New[K comparable, V any](capacity int) *builder[K, V]
New initializes a builder to create an LFU cache.
Types ¶
type LFU ¶
type LFU[K comparable, V any] struct { // contains filtered or unexported fields }
LFU is a configured least frequently used cache ready for use.
func (*LFU[K, V]) Get ¶
Get attempts to find an existing cache entry by key. It returns an Option you must check before using the underlying value.
func (*LFU[K, V]) Len ¶
Len returns the current size of the cache. The result will include items that may be expired past the max age as they are passively expired.
Click to show internal directories.
Click to hide internal directories.