Help us shape the future of Go! Take the 2026 Go Developer Survey

factory

package
v0.47.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLedger

func NewLedger(config Config, triggerCheckpoint *atomic.Bool) (ledger.Ledger, error)

NewLedger creates a ledger instance based on the configuration. If LedgerServiceAddr is set, it creates a remote ledger client. Otherwise, it creates a local ledger with WAL and compactor. triggerCheckpoint is a runtime control signal to trigger checkpoint on next segment finish (can be nil for remote ledger).

Types

type Config

type Config struct {
	// Remote ledger service configuration
	LedgerServiceAddr     string // gRPC address for remote ledger service (empty means use local ledger)
	LedgerMaxRequestSize  uint   // Maximum request message size in bytes for remote ledger client (0 = default 1 GiB)
	LedgerMaxResponseSize uint   // Maximum response message size in bytes for remote ledger client (0 = default 1 GiB)

	// Local ledger configuration
	Triedir            string
	MTrieCacheSize     uint32
	CheckpointDistance uint
	CheckpointsToKeep  uint
	MetricsRegisterer  prometheus.Registerer
	WALMetrics         module.WALMetrics
	LedgerMetrics      module.LedgerMetrics
	Logger             zerolog.Logger
}

Config holds configuration for creating a ledger instance.

Jump to

Keyboard shortcuts

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