bootstrap

package
v3.5.0-beta.21 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ApplicationName = "ledger"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	EnvName  string `env:"ENV_NAME"`
	LogLevel string `env:"LOG_LEVEL"`
	Version  string `env:"VERSION"`

	// OpenTelemetry configuration
	OtelServiceName         string `env:"OTEL_RESOURCE_SERVICE_NAME"`
	OtelLibraryName         string `env:"OTEL_LIBRARY_NAME"`
	OtelServiceVersion      string `env:"OTEL_RESOURCE_SERVICE_VERSION"`
	OtelDeploymentEnv       string `env:"OTEL_RESOURCE_DEPLOYMENT_ENVIRONMENT"`
	OtelColExporterEndpoint string `env:"OTEL_EXPORTER_OTLP_ENDPOINT"`
	EnableTelemetry         bool   `env:"ENABLE_TELEMETRY"`
}

Config is the top level configuration struct for the unified ledger component.

type Options

type Options struct {
	// Logger allows callers to provide a pre-configured logger, avoiding multiple
	// initializations when composing components (e.g. unified ledger).
	Logger libLog.Logger
}

Options contains optional dependencies that can be injected by callers.

type Service

type Service struct {
	OnboardingService  mbootstrap.Service
	TransactionService transaction.TransactionService
	Logger             libLog.Logger
	Telemetry          *libOpentelemetry.Telemetry
}

Service is the unified ledger service that composes onboarding and transaction.

func InitServers

func InitServers() (*Service, error)

InitServers initializes the unified ledger service that composes both onboarding and transaction modules in a single process. The transaction module is initialized first so its BalancePort (the UseCase) can be passed directly to onboarding for in-process calls.

func InitServersWithOptions

func InitServersWithOptions(opts *Options) (*Service, error)

InitServersWithOptions initializes the unified ledger service with optional dependency injection.

func (*Service) Run

func (s *Service) Run()

Run starts both onboarding and transaction services in the same process. It collects all runnables from both services and launches them with a unified launcher.

Jump to

Keyboard shortcuts

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