badger

package
v0.0.0-...-3e87057 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Badger data directory
	DataDir string `yaml:"datadir"`
	// Badger metadata directory
	MetaDir string `yaml:"metadir"`
}

Config represents badger DB configuration

type DB

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

DB defines a metastor database implementation, using badger on the local FS as its underlying storage medium.

func New

func New(data, meta string) (*DB, error)

New creates a new metastor database implementation, using badger on the local FS as storage medium.

Both the data and meta dir are required. If you want to be able to specify more options than just the required data and metadata directory, you can make use of the `NewWithOpts` function, as this function will use default options for all other badger options.

func NewWithOpts

func NewWithOpts(opts badgerdb.Options) (*DB, error)

NewWithOpts creates a new metastor database implementation, using badger on the local FS as storage medium.

Both the data and meta dir, defined as properties of the given options, are required.

func (*DB) Close

func (db *DB) Close() error

Close implements metastor.Client.Close

func (*DB) Delete

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

Delete implements db.Delete

func (*DB) Get

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

Get implements db.Get

func (*DB) ListKeys

func (db *DB) ListKeys(namespace []byte, cb dbp.ListCallback) error

ListKeys implements db.ListKeys

func (*DB) Set

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

Set implements db.Set

func (*DB) Update

func (db *DB) Update(namespace, key []byte, cb dbp.UpdateCallback) error

Update implements db.Update

Jump to

Keyboard shortcuts

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