database

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 20, 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 BadgerDB

type BadgerDB struct {
	*badger.DB
	// contains filtered or unexported fields
}

BadgerDB is a wrapper around the standard badger.DB that provides a background compaction routine.

func Open

func Open(path string) (*BadgerDB, error)

Open opens (initializing if necessary) a Badger database at the specified path. Users must close the DB with Close().

func OpenTruncate added in v0.0.3

func OpenTruncate(path string) (*BadgerDB, error)

OpenTruncate opens (initializing and/or truncating if necessary) a Badger database at the specified path. Users must close the DB with Close().

Prefer Open in the general case, but after a bad shutdown it may be necessary to call OpenTruncate. This may cause data loss. Detect this situation by looking for badger.ErrTruncateNeeded.

func (*BadgerDB) Close

func (b *BadgerDB) Close() error

Close closes the database connection and releases the associated resources.

Jump to

Keyboard shortcuts

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