lru

package
v0.0.0-...-15722f1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.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 Entry

type Entry struct {
	Key string
	Val Value
}

func NewEntry

func NewEntry(key string, val Value) *Entry

type LRUCache

type LRUCache struct {
	// contains filtered or unexported fields
}

func NewLRUCache

func NewLRUCache(capacity int64, onEvicted func(string, Value)) *LRUCache

func (*LRUCache) Get

func (l *LRUCache) Get(key string) (Value, bool)

func (*LRUCache) Len

func (l *LRUCache) Len() int

func (*LRUCache) Put

func (l *LRUCache) Put(key string, value Value)

func (*LRUCache) RemoveOldest

func (l *LRUCache) RemoveOldest()

type Value

type Value interface {
	Len() int
}

Jump to

Keyboard shortcuts

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