cache

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lru

type Lru interface {
	Get(key interface{}) (value interface{}, ok bool)
	GetKeyFromValue(value interface{}) (key interface{}, ok bool)
	Put(key, value interface{})
	// ForEach visits entries from most-recently-used to least-recently-used. Stops early if fn returns false.
	ForEach(fn func(key, value interface{}) bool)
}

Lru simple, fast lru cache implementation

func NewLru

func NewLru(cap int) Lru

NewLru initializes a lru cache

func NewLru1 added in v1.0.7

func NewLru1(cap int) Lru

NewLru1 creates a new memory-efficient LRU cache

Jump to

Keyboard shortcuts

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