badger

package
v1.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TruncateBadger = false

TruncateBadger controls whether Badger is configured to truncate corrupted data. Especially on Windows, if the node is terminated abruptly, setting this may be necessary to recovering the state of the system.

However, Accumulate is not robust against this kind of interruption. If the node is terminated abruptly and restarted with this flag, some functions may break, such as synthetic transactions and anchoring.

Functions

This section is empty.

Types

type Batch

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

func (*Batch) Begin

func (b *Batch) Begin(writable bool) storage.KeyValueTxn

func (*Batch) Commit

func (b *Batch) Commit() error

func (*Batch) Discard

func (b *Batch) Discard()

func (*Batch) Get

func (b *Batch) Get(key storage.Key) (v []byte, err error)

func (*Batch) Put

func (b *Batch) Put(key storage.Key, value []byte) error

func (*Batch) PutAll

func (b *Batch) PutAll(values map[storage.Key][]byte) error

type DB

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

func New

func New(filepath string, logger storage.Logger) (*DB, error)

func (*DB) Begin

func (db *DB) Begin(writable bool) storage.KeyValueTxn

func (*DB) Close

func (d *DB) Close() error

Close Close the underlying database

Jump to

Keyboard shortcuts

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