boltdb

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Error = errs.Class("boltdb error")

Error is the default boltdb errs class

Functions

This section is empty.

Types

type Client

type Client struct {
	Path   string
	Bucket []byte
	// contains filtered or unexported fields
}

Client is the entrypoint into a bolt data store

func New

func New(path, bucket string) (*Client, error)

New instantiates a new BoltDB client given db file path, and a bucket name

func NewShared

func NewShared(path string, buckets ...string) ([]*Client, error)

NewShared instantiates a new BoltDB with multiple buckets

func (*Client) Close

func (client *Client) Close() error

Close closes a BoltDB client

func (*Client) Delete

func (client *Client) Delete(key storage.Key) error

Delete deletes a key/value pair from boltdb, for a given the key

func (*Client) Get

func (client *Client) Get(key storage.Key) (storage.Value, error)

Get looks up the provided key from boltdb returning either an error or the result.

func (*Client) GetAll

func (client *Client) GetAll(keys storage.Keys) (storage.Values, error)

GetAll finds all values for the provided keys (up to storage.LookupLimit). If more keys are provided than the maximum, an error will be returned.

func (*Client) Iterate

func (client *Client) Iterate(opts storage.IterateOptions, fn func(storage.Iterator) error) error

Iterate iterates over items based on opts

func (*Client) List

func (client *Client) List(first storage.Key, limit int) (storage.Keys, error)

List returns either a list of keys for which boltdb has values or an error.

func (*Client) Put

func (client *Client) Put(key storage.Key, value storage.Value) error

Put adds a value to the provided key in boltdb, returning an error on failure.

Jump to

Keyboard shortcuts

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