badger

package
v0.0.0-...-1a11905 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 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 DB

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

DB is a wrapper over *badger.DB,

func (*DB) Close

func (db *DB) Close() error

Close closes the DB database.

func (*DB) CmpAndSwap

func (db *DB) CmpAndSwap(bucket, key, oldValue, newValue []byte) ([]byte, bool, error)

CmpAndSwap modifies the value at the given bucket and key (to newValue) only if the existing (current) value matches oldValue.

func (*DB) CreateTable

func (db *DB) CreateTable(bucket []byte) error

CreateTable creates a token element with the 'bucket' prefix so that such that their appears to be a table.

func (*DB) Del

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

Del deletes the value stored in the given bucked and key.

func (*DB) DeleteTable

func (db *DB) DeleteTable(bucket []byte) error

DeleteTable deletes a root or embedded bucket. Returns an error if the bucket cannot be found or if the key represents a non-bucket value.

func (*DB) Get

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

Get returns the value stored in the given bucked and key.

func (*DB) List

func (db *DB) List(bucket []byte) ([]*database.Entry, error)

List returns the full list of entries in a bucket.

func (*DB) Open

func (db *DB) Open(dir string, opt ...database.Option) (err error)

Open opens or creates a BoltDB database in the given path.

func (*DB) Set

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

Set stores the given value on bucket and key.

func (*DB) Update

func (db *DB) Update(txn *database.Tx) error

Update performs multiple commands on one read-write transaction.

Jump to

Keyboard shortcuts

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