gcstore

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Generic storage for garbage collected entries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCStore

type GCStore interface {
	// Put a key-value into the store. Keys must be comparable.
	Put(key, value interface{})

	// Gets the value of a specified key. If the key is not present,
	// nil is returned.
	Get(key interface{}) interface{}
}

Garbage collected key-value store. Items that are not accessed after a certain amount of time are garbage collected. Keys must be comparable.

Implementation is thread-safe.

func New

func New(ttl time.Duration) GCStore

Jump to

Keyboard shortcuts

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