lru

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2019 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 Key

type Key interface{}

type Lru

type Lru struct {
	// MaxEntries is the maximum number of cache entries
	// before an item is evicted. Zero means no limit.
	MaxEntries int

	// LoadFunc specifies the function that loads a value
	// for a specific key when not found in the cache.
	LoadFunc func(ctx aws.Context, key Key) (interface{}, error)

	// Optional KeyMarshaller. Caller should provide one when using
	// Key type which is not comparable. eg. slice
	KeyMarshaller func(key Key) Key
	// contains filtered or unexported fields
}

Lru is a cache which is safe for concurrent access.

func (*Lru) GetWithContext

func (c *Lru) GetWithContext(ctx aws.Context, okey Key) (interface{}, error)

Jump to

Keyboard shortcuts

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