database

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: Apache-2.0, BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	// DBVersion defines the version of the database schema this version of ZIPP supports.
	// Every time there's a breaking change regarding the stored data, this version flag should be adjusted.
	DBVersion = 66
)
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 = &ParametersDefinition{}

Parameters contains configuration parameters used by the storage layer.

View Source
var (
	// Plugin is the plugin instance of the database plugin.
	Plugin *node.Plugin
)

Functions

func CacheTimeProvider

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.

Types

type ParametersDefinition

type ParametersDefinition struct {
	// Directory defines the directory of the database.
	Directory string `default:"mainnetdb" usage:"path to the database directory"`

	// InMemory defines whether to use an in-memory database.
	InMemory bool `default:"false" usage:"whether the database is only kept in memory and not persisted"`

	// Dirty defines whether to override the database dirty flag.
	Dirty string `default:"false" usage:"set the dirty flag of the database"`

	// ForceCacheTime is a new global cache time in seconds for object storage.
	ForceCacheTime time.Duration `` /* 143-byte string literal not displayed */
}

ParametersDefinition contains the definition of configuration parameters used by the storage layer.

Jump to

Keyboard shortcuts

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