Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct {
LogConfig bool `yaml:"LogConfig"`
Logger logger.Config `yaml:"Logger"`
ConfigReader configutils.Config `yaml:"ConfigReader"`
AppNames []string `yaml:"AppNames"`
Server Server `yaml:"Server" `
Repository repo.Config `yaml:"Repository"`
Service service.Config `yaml:"Service"`
Worker Worker `yaml:"Worker"`
Ledger ledger.ChartConfig `yaml:"Ledger"`
Telemetry telemetry.Config `yaml:"Telemetry"`
Debug debug.Config `yaml:"Debug"`
}
func LoadConfig ¶
func LoadConfig(ctx context.Context, path string, env string) *Configuration
type Server ¶
type Server struct {
GRPCPort int `yaml:"GRPCPort"`
HTTPPort int `yaml:"HTTPPort"`
// RateLimit caps each service credential's request rate, per instance.
RateLimit ratelimit.Config `yaml:"RateLimit"`
// CORS headers on HTTP answers. On unless switched off: turn it off behind
// a gateway that adds its own, or browsers see them twice and refuse.
CORS CORS `yaml:"CORS"`
}
type Worker ¶
type Worker struct {
Outbox outbox.Config `yaml:"Outbox"`
// IdempotencySweepInterval controls how often expired idempotency keys are
// pruned. This is also what frees keys abandoned by a crashed process.
IdempotencySweepInterval time.Duration `yaml:"IdempotencySweepInterval"`
// IdempotencySweepBatch caps rows deleted per sweep, so pruning a backlog
// never becomes one enormous delete.
IdempotencySweepBatch int `yaml:"IdempotencySweepBatch"`
// LedgerCheckInterval controls how often the ledger invariant checks run.
// They also run once at startup, so a deploy is followed by a verdict.
LedgerCheckInterval time.Duration `yaml:"LedgerCheckInterval"`
// HoldSweepInterval controls how often expired holds are released. Short,
// because an expired hold is customer money locked for nothing.
HoldSweepInterval time.Duration `yaml:"HoldSweepInterval"`
// WalletExpiryInterval controls how often dormant rolling-expiry wallets
// are lapsed. Expiry is measured in days, so hourly is plenty.
WalletExpiryInterval time.Duration `yaml:"WalletExpiryInterval"`
// PaymentEventInterval is how often stored webhooks are processed when
// the queue is idle. A backlog is drained without waiting for it.
PaymentEventInterval time.Duration `yaml:"PaymentEventInterval"`
// PaymentPollInterval is how often open payments are checked with their
// provider — the safety net for webhooks that never arrive.
PaymentPollInterval time.Duration `yaml:"PaymentPollInterval"`
// ReconInterval is how often settlements are ingested and reconciled.
ReconInterval time.Duration `yaml:"ReconInterval"`
// OpsMetricsInterval is how often the operational gauges (stuck
// payments, webhook backlog, hold leakage, provider success rates) are
// read from the database.
OpsMetricsInterval time.Duration `yaml:"OpsMetricsInterval"`
}
Worker configures the background job runner. It lives here rather than in cmd/worker because cmd packages import configs, not the other way round.
func (*Worker) WithDefaults ¶
func (w *Worker) WithDefaults()
Click to show internal directories.
Click to hide internal directories.