bolt

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: Apache-2.0 Imports: 5 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 bolt.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 bucket or an embedded bucket if it does not exists.

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(dataSourceName string, opt ...database.Option) (err error)

Open opens or creates a DB 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(tx *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