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 ¶
DefaultBadgerDBConfig returns a default BadgerDB configuration.
func DefaultLevelDBConfig ¶
DefaultLevelDBConfig returns a default LevelDB configuration.
func DefaultMemoryConfig ¶
func DefaultMemoryConfig() *Config
DefaultMemoryConfig returns a default in-memory database configuration.
func DefaultPebbleDBConfig ¶
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.
Click to show internal directories.
Click to hide internal directories.