caches

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MissingValueError = errors.New("cached value not found")

Functions

func New2Q added in v0.1.2

func New2Q(capacity int) hashi2Q

func NewLRUCache

func NewLRUCache(capacity int) *lruCache

~ 48 bytes per entry.

Types

type Interface

type Interface interface {
	Keys() []Key

	// Insert the given key/value pair into the cache returning the evicted value if any, else return nil.
	Put(Key, Value) Value

	// Retrieve the corrosponding value if present, else return `caches.MissingValueError`
	Get(Key) (Value, error)
}

type Key

type Key interface{}

type Value

type Value interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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