lru

package
v0.0.0-...-c9e5fdf Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2014 License: MIT, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

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

Datastore uses golang-lru for internal storage.

func NewDatastore

func NewDatastore(capacity int) (*Datastore, error)

NewDatastore constructs a new LRU Datastore with given capacity.

func (*Datastore) Delete

func (d *Datastore) Delete(key ds.Key) (err error)

Delete removes the value for given `key`.

func (*Datastore) Get

func (d *Datastore) Get(key ds.Key) (value interface{}, err error)

Get retrieves the object `value` named by `key`.

func (*Datastore) Has

func (d *Datastore) Has(key ds.Key) (exists bool, err error)

Has returns whether the `key` is mapped to a `value`.

func (*Datastore) KeyList

func (d *Datastore) KeyList() ([]ds.Key, error)

KeyList returns a list of keys in the datastore

func (*Datastore) Put

func (d *Datastore) Put(key ds.Key, value interface{}) (err error)

Put stores the object `value` named by `key`.

Jump to

Keyboard shortcuts

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