Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry[K comparable, V any] struct { // The LRU Key of this element. Key K // The Value stored with this element. Value V // contains filtered or unexported fields }
Entry is an LRU Entry
type LruList ¶
type LruList[K comparable, V any] struct { // contains filtered or unexported fields }
LruList represents a doubly linked list. The zero Value for LruList is an empty list ready to use.
func NewList ¶
func NewList[K comparable, V any]() *LruList[K, V]
NewList returns an initialized list.
func (*LruList[K, V]) Length ¶
Length returns the number of elements of list l. The complexity is O(1).
func (*LruList[K, V]) MoveToFront ¶
MoveToFront moves element e to the front of list l. If e is not an element of l, the list is not modified. The element must not be nil.
Click to show internal directories.
Click to hide internal directories.