cache

package
v0.0.0-...-01ee8fb Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const KeyLength = 16

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	// Insert the given value into the cache. The value must not be the nil
	// interface, and its type must have been previously registered using
	// gob.Register.
	Insert(key Key, value interface{})

	// Look up a previously-inserted value fo the given key. Return nil if no
	// value is present.
	LookUp(key Key) interface{}
}

A cache mapping from string keys to arbitrary values. Safe for concurrent access, and supports gob encoding.

func NewLruCache

func NewLruCache(capacity uint) Cache

Create a cache that holds the given number of items, evicting the least recently used item when more space is needed.

type Key

type Key [KeyLength]byte

Jump to

Keyboard shortcuts

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