leveldb

package
v0.0.0-...-6803a88 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Supplier

func Supplier() (store streams.Store)

Supplier for leveldb store

Types

type DB

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

DB is a durable leveldb key value state store

func (*DB) Close

func (d *DB) Close() (err error)

Close the store releasing its resources.

func (*DB) Delete

func (d *DB) Delete(key []byte) (err error)

Delete value for the given key.

func (*DB) Get

func (d *DB) Get(key []byte) (value []byte, err error)

Get value for the given key.

func (*DB) Init

func (d *DB) Init(pc streams.ProcessorContext) (err error)

Init store

func (*DB) Name

func (d *DB) Name() (name string)

Name returns this store name.

func (*DB) Process

func (d *DB) Process(pc streams.ProcessorContext, record streams.Record)

Process store or deletes any forwarded record to the store. Records with empty values deletes the given key from the store.

func (*DB) Range

func (d *DB) Range(from, to []byte, cb func(key, value []byte) error) (err error)

Range iterates the store within the given key range applying the callback for the key value pairs. Returning a error causes the iteration to stop. A nil from or to sets the iterator to the begining or end of Store. Setting both from and to as nil iterates the whole store

func (*DB) RangePrefix

func (d *DB) RangePrefix(prefix []byte, cb func(key, value []byte) error) (err error)

RangePrefix iterates the store over a key prefix applying the callback for the key value pairs. Returning a error causes the iteration to stop.

func (*DB) Remove

func (d *DB) Remove() (err error)

Remove closes the store and erases its contents

func (*DB) Set

func (d *DB) Set(key, value []byte) (err error)

Set value for the given key.

Jump to

Keyboard shortcuts

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