Skip to content

Latest commit

 

History

History
98 lines (77 loc) · 5.66 KB

File metadata and controls

98 lines (77 loc) · 5.66 KB

Configuration

The Go port deliberately does not ship a YAML configuration loader in v26.04.01 — services compose their configuration in main.go, keeping the dependency graph small and the wiring explicit.

This document captures the canonical configuration shape that maps 1:1 onto the Java application.yml keys and the .NET appsettings.json sections, so that operators can translate ops-runbooks across runtimes without re-learning the field names.

Top-level — startercore.Config

startercore.Config{
    AppName:     "orders-service",   // → firefly.app.name
    StarterName: "starter-core",     // → firefly.starter.name
    Logger:      slog.Logger{...},   // optional override
    Cache:       cache.Adapter{...}, // optional override
    Bus:         cqrs.Bus{...},      // optional override
    Broker:      eda.Broker{...},    // optional override
    Idempotency: &web.IdempotencyConfig{...},
    Health:      observability.Composite{...},
}

Cache — cache.Adapter

Java key Go wiring
firefly.cache.adapter=memory cache.NewMemory() (default)
firefly.cache.adapter=noop cache.NoOp{}
firefly.cache.adapter=redis (next release) cacheredis.New(host, opts)
firefly.cache.fallback.adapter=memory cache.NewFallback(primary, secondary)
firefly.cache.ttl Per-call TTL on Set / Typed.GetOrSet

Idempotency — web.IdempotencyConfig

Java key Go field
firefly.idempotency.enabled Don't apply the middleware
firefly.idempotency.ttl IdempotencyConfig.TTL
firefly.idempotency.methods IdempotencyConfig.Methods
firefly.idempotency.store=memory web.NewMemoryIdempotencyStore() (default)
firefly.idempotency.store=redis (next release) idemredis.New(...)

Observability — observability.LogConfig

Java key Go field
firefly.logging.level LogConfig.Level (slog.Level)
firefly.logging.format=json LogConfig.Format = "json" (default)
firefly.logging.format=text LogConfig.Format = "text"
firefly.app.name LogConfig.Service

EDA — eda.Broker

Java key Go wiring
firefly.eda.broker=in-memory eda.NewInMemory() (default)
firefly.eda.broker=kafka (next release) eda.NewKafkaBroker(ctx, KafkaConfig{...})
firefly.eda.broker=rabbitmq (next release) eda.NewRabbitMQBroker(ctx, RabbitMQConfig{...})
firefly.eda.kafka.brokers KafkaConfig.Brokers []string
firefly.eda.kafka.consumerGroup KafkaConfig.ConsumerGroup
firefly.eda.rabbitmq.url RabbitMQConfig.URL

IDP — idp.Adapter

Java key Go wiring
firefly.idp.adapter=internal-db idpinternaldb.New(idpinternaldb.Config{...})
firefly.idp.adapter=keycloak (next release) idpkeycloak.New(...)
firefly.idp.internal-db.jwt.secret idpinternaldb.Config.JWTSecret
firefly.idp.internal-db.token.ttl idpinternaldb.Config.TokenTTL

Callbacks — callbacks/core.Config

Java key Go field
firefly.callbacks.dispatcher.timeout Config.HTTPClient.Timeout
firefly.callbacks.dispatcher.retries Config.MaxAttempts
firefly.callbacks.dispatcher.initialDelay Config.InitialDelay

Webhooks — webhooks/core.Pipeline

Validators are registered explicitly per provider:

p := webhookscore.NewPipeline(webhookscore.NewMemoryDLQ())
p.RegisterValidator(webhookscore.NewStripeValidator(stripeSecret))
p.RegisterValidator(webhookscore.NewGitHubValidator(githubSecret))

Future: YAML loader

The 26.05 cycle will ship a firefly-config-yaml module that maps a file (or a pulled configserver Environment) onto the Config structs documented above, mirroring the Spring Boot binding rules.