factory

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: BSD-3-Clause Imports: 12 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	name string,
	dbPath string,
	readOnly bool,
	config []byte,
	gatherer interface{},
	logger log.Logger,
	metricsPrefix string,
	meterDBRegName string,
) (database.Database, error)

New creates a new database with the provided configuration

func NewFromConfig added in v1.0.3

func NewFromConfig(cfg DatabaseConfig) (database.Database, error)

NewFromConfig creates a new database from a DatabaseConfig

Types

type DatabaseConfig added in v1.0.3

type DatabaseConfig struct {
	Type           string
	Dir            string
	Name           string
	ReadOnly       bool
	Config         []byte
	MetricsReg     prometheus.Registerer
	Logger         log.Logger
	MetricsPrefix  string
	MeterDBRegName string
}

DatabaseConfig is a convenience struct for database configuration

Jump to

Keyboard shortcuts

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