configs

package
v0.0.0-...-5d187b5 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CORS

type CORS struct {
	Enabled *bool `yaml:"Enabled"`
}

func (CORS) On

func (c CORS) On() bool

On reports whether CORS headers are added; true when not configured.

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()

Jump to

Keyboard shortcuts

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