database

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: Apache-2.0, BSD-2-Clause Imports: 14 Imported by: 1

Documentation

Overview

Package database is a plugin that manages the RocksDB 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 = 38
)
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")
)
View Source
var Parameters = struct {
	// CacheTimeProvider  is a new global cache time in seconds for object storage.
	ForceCacheTime time.Duration `` /* 143-byte string literal not displayed */
}{}

Parameters contains configuration parameters used by the storage layer.

Functions

func CacheTimeProvider added in v0.7.3

func CacheTimeProvider() *database.CacheTimeProvider

CacheTimeProvider returns the cacheTimeProvider instance

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