lru

package
v1.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[K any] struct {
	// contains filtered or unexported fields
}

func NewLRUCache

func NewLRUCache[K any](capacity int) *Cache[K]

func (*Cache[K]) Get

func (c *Cache[K]) Get(key string) (K, bool)

func (*Cache[K]) Put

func (c *Cache[K]) Put(key string, value K)

type Value

type Value[K any] struct {
	Value   K
	Element *list.Element
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL