boltdb

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltDB

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

BoltDB implements backend.Store interface.

func New

func New(opts Options) *BoltDB

New is a factory method to creates a boltdb instance. Note that it will not open a boltDB immediately until used.

func (*BoltDB) Close

func (b *BoltDB) Close() error

Close cloes the boltDB.

func (*BoltDB) Get

func (b *BoltDB) Get(k []byte) (v []byte, e error)

Get gets a value by given key from boltDB.

func (*BoltDB) Iter

func (b *BoltDB) Iter(iterCb func(k, v []byte) error) error

Iter iterates all key-value pairs from the boltDB.

func (*BoltDB) Put

func (b *BoltDB) Put(k, v []byte) error

Put puts a key-value pair into the boltDB.

func (*BoltDB) Remove

func (b *BoltDB) Remove(k []byte) error

Remove removes a key-value pair from the boltDB.

type Options

type Options struct {
	Path    string
	Mode    os.FileMode
	Bucket  string
	Options *bolt.Options
}

Options configures boltdb instance.

Jump to

Keyboard shortcuts

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