badger

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2021 License: MIT Imports: 4 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 {
	DBHome string
	// contains filtered or unexported fields
}

func (*DB) Close

func (d *DB) Close() error

Close Close the underlying database

func (*DB) Get

func (d *DB) Get(key [storage.KeyLength]byte) (value []byte)

Get Look in the given bucket, and return the key found. Returns nil if no value is found for the given key

func (*DB) InitDB

func (d *DB) InitDB(filepath string) error

InitDB Initialize the database by the given filename (includes directory path). This will certainly open an existing database, but will also initialize an new, empty database.

func (*DB) Put

func (d *DB) Put(key [storage.KeyLength]byte, value []byte) error

Put Put a key/value in the database. We return an error if there was a problem writing the key/value pair to the database.

func (*DB) PutBatch

func (d *DB) PutBatch(TXList []storage.TX) error

PutBatch Write all the transactions in a given batch of pending transactions. The batch is emptied, so it can be reused.

Jump to

Keyboard shortcuts

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