badger

package
v1.2.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 11 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 ChangeSet

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

func (*ChangeSet) Begin

func (c *ChangeSet) Begin(prefix *record.Key, writable bool) keyvalue.ChangeSet

Begin begins a nested change set.

func (*ChangeSet) Commit

func (c *ChangeSet) Commit() error

func (*ChangeSet) Delete

func (c *ChangeSet) Delete(key *record.Key) error

func (*ChangeSet) Discard

func (c *ChangeSet) Discard()

func (*ChangeSet) Get

func (c *ChangeSet) Get(key *record.Key) ([]byte, error)

func (*ChangeSet) Put

func (c *ChangeSet) Put(key *record.Key, value []byte) error

type Database

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

func New

func New(filepath string) (*Database, error)

func (*Database) Begin

func (d *Database) Begin(prefix *record.Key, writable bool) keyvalue.ChangeSet

Begin begins a change set.

func (*Database) Close

func (d *Database) 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