manager

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2025 License: BSD-3-Clause Imports: 12 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Type is the database type ("leveldb", "pebbledb", "memdb")
	Type string

	// Path is the database path (relative to base directory)
	Path string

	// Namespace is used for metrics
	Namespace string

	// CacheSize is the size of the cache in MB
	CacheSize int

	// HandleCap is the maximum number of open file handles
	HandleCap int

	// EnableMetrics enables prometheus metrics
	EnableMetrics bool

	// EnableVersioning enables database versioning
	EnableVersioning bool

	// Prefix adds a prefix to all keys
	Prefix []byte

	// ReadOnly opens the database in read-only mode
	ReadOnly bool
}

Config defines the database configuration.

func DefaultBadgerDBConfig

func DefaultBadgerDBConfig(path string) *Config

DefaultBadgerDBConfig returns a default BadgerDB configuration.

func DefaultLevelDBConfig

func DefaultLevelDBConfig(path string) *Config

DefaultLevelDBConfig returns a default LevelDB configuration.

func DefaultMemoryConfig

func DefaultMemoryConfig() *Config

DefaultMemoryConfig returns a default in-memory database configuration.

func DefaultPebbleDBConfig

func DefaultPebbleDBConfig(path string) *Config

DefaultPebbleDBConfig returns a default PebbleDB configuration.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager is a database manager that can create new database instances.

func NewManager

func NewManager(baseDir string, registerer prometheus.Registerer) *Manager

NewManager creates a new database manager.

func (*Manager) New

func (m *Manager) New(config *Config) (db.Database, error)

New creates a new database instance.

Jump to

Keyboard shortcuts

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