Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultLRUCapacity = 20
DefaultLRUCapacity is the default capacity of the LRU cache.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry[K comparable, V any] struct { // contains filtered or unexported fields }
Entry represents an item in the cache.
type LRUCache ¶
type LRUCache[K comparable, V any] struct { sync.RWMutex // contains filtered or unexported fields }
LRUCache represents the LRU cache.
func NewLRUCache ¶
func NewLRUCache[K comparable, V any](capacity uint) *LRUCache[K, V]
NewLRUCache creates a new LRU cache with the specified capacity.
Click to show internal directories.
Click to hide internal directories.