db

package
v0.0.0-...-77fbf23 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2019 License: GPL-3.0 Imports: 1 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
}

Db is the database with the specified prefix

func New

func New(path string) (*Db, error)

New creates a new Db database

func (*Db) Get

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

Get retreives a value from the database for a given key

func (*Db) Iterate

func (db *Db) Iterate(f func([]byte, []byte)) error

Iterate iterates over the database

func (*Db) Put

func (db *Db) Put(key, value []byte) error

Put adds the key value to the database

func (*Db) WithPrefix

func (db *Db) WithPrefix(prefix []byte) *Db

WithPrefix returns a subdatabase with the specified prefix

Jump to

Keyboard shortcuts

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