lru

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: May 10, 2015 License: MIT, MIT Imports: 4 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) Put

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

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

func (*Datastore) Query

func (d *Datastore) Query(q dsq.Query) (dsq.Results, error)

KeyList returns a list of keys in the datastore

Jump to

Keyboard shortcuts

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