database

package
v0.2.4-0...-2c2ceb1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: Apache-2.0, BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package database is a plugin that manages the badger database (e.g. garbage collection).

Index

Constants

View Source
const (
	// CfgDatabaseDir defines the directory of the database.
	CfgDatabaseDir = "database.directory"
	// CfgDatabaseInMemory defines whether to use an in-memory database.
	CfgDatabaseInMemory = "database.inMemory"
	// CfgDatabaseDirty defines whether to override the database dirty flag.
	CfgDatabaseDirty = "database.dirty"
)
View Source
const (
	// DBVersion defines the version of the database schema this version of GoShimmer supports.
	// Every time there's a breaking change regarding the stored data, this version flag should be adjusted.
	DBVersion = 11
)
View Source
const PluginName = "Database"

PluginName is the name of the database plugin.

Variables

View Source
var (
	// ErrDBVersionIncompatible is returned when the database has an unexpected version.
	ErrDBVersionIncompatible = errors.New("database version is not compatible. please delete your database folder and restart")
)

Functions

func IsDatabaseUnhealthy

func IsDatabaseUnhealthy() bool

IsDatabaseUnhealthy tells whether the database is unhealthy, meaning not shutdown properly.

func MarkDatabaseHealthy

func MarkDatabaseHealthy()

MarkDatabaseHealthy marks the database as healthy, respectively correctly closed.

func MarkDatabaseUnhealthy

func MarkDatabaseUnhealthy()

MarkDatabaseUnhealthy marks the database as not healthy, meaning that it wasn't shutdown properly.

func Plugin

func Plugin() *node.Plugin

Plugin gets the plugin instance.

func Store

func Store() kvstore.KVStore

Store returns the KVStore instance.

func StoreRealm

func StoreRealm(realm kvstore.Realm) kvstore.KVStore

StoreRealm is a factory method for a different realm backed by the KVStore instance.

Types

This section is empty.

Jump to

Keyboard shortcuts

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