Documentation
¶
Overview ¶
Package lru implements a generic least-recently-used cache.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LRU ¶
type LRU[K comparable, V any] struct { // contains filtered or unexported fields }
LRU is a fixed-size least-recently-used cache.
func New ¶
func New[K comparable, V any](size int) *LRU[K, V]
New creates a new LRU cache with the given maximum size.
Click to show internal directories.
Click to hide internal directories.