leveldb

package
v0.0.0-...-b6322a5 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

A DB is the core storage layer

func NewDB

func NewDB(filepath string) (*DB, error)

NewDB constructs a new LevelDB backed KV store

func NewMem

func NewMem() (*DB, error)

NewMem makes an in-mem levelDB

func (*DB) Get

func (db *DB) Get(key []byte) ([]byte, error)

Get returns the value at a certain key

func (*DB) Set

func (db *DB) Set(key []byte, val []byte) error

Set sets the given key to a value

func (*DB) Walk

func (db *DB) Walk(prefix []byte) (voodoo.Iterator, error)

Walk is used to traverse parts of the keyspace

type Iterator

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

An Iterator is used to walk the keyspace

func (*Iterator) First

func (i *Iterator) First() bool

move to the first key

func (*Iterator) Key

func (i *Iterator) Key() []byte

get the current key

func (*Iterator) Last

func (i *Iterator) Last() bool

move to the last key

func (*Iterator) Next

func (i *Iterator) Next() bool

move to the next key

func (*Iterator) Prev

func (i *Iterator) Prev() bool

move to the previous key

func (*Iterator) Val

func (i *Iterator) Val() []byte

get the value at the iterator location

Jump to

Keyboard shortcuts

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