lru

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2016 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) Batch added in v0.3.8

func (d *Datastore) Batch() (ds.Batch, error)

func (*Datastore) Close added in v0.3.8

func (d *Datastore) Close() error

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