autobatch

package module
v0.0.0-...-24ddfa3 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: MIT Imports: 2 Imported by: 3

README

autobatch

Autobatch is an implementation of go-datastore that automatically batches together writes by holding puts in memory until a certain threshold is met. This can improve disk performance at the cost of memory in certain situations.

Usage

Simply wrap your existing datastore in an autobatching layer like so:

bds := NewAutoBatching(basedstore, 128)

And make all future calls to the autobatching object.

License

MIT

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
}

func NewAutoBatching

func NewAutoBatching(d ds.Batching, size int) *Datastore

func (*Datastore) Delete

func (d *Datastore) Delete(k ds.Key) error

func (*Datastore) Flush

func (d *Datastore) Flush() error

func (*Datastore) Get

func (d *Datastore) Get(k ds.Key) (interface{}, error)

func (*Datastore) Has

func (d *Datastore) Has(k ds.Key) (bool, error)

func (*Datastore) Put

func (d *Datastore) Put(k ds.Key, val interface{}) error

func (*Datastore) Query

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

Jump to

Keyboard shortcuts

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