config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	StorageBackend string

	DatabaseURL string

	Port int
	Env  string

	CephMonitors []string
	CephPool     string
	CephKeyring  string

	OtelExporter       string
	OtelJaegerEndpoint string
	OtelServiceName    string

	RetryPolicy     RetryPolicy
	ReconcilePolicy ReconcilePolicy
}

Config holds all runtime configuration loaded from environment variables.

func Load

func Load() (*Config, error)

Load reads configuration from environment variables and validates it.

type ReconcilePolicy

type ReconcilePolicy struct {
	// DBOnly is the action when a volume exists in DB but not in Ceph.
	// Values: "error" (default) | "delete" | "ignore"
	DBOnly string

	// CephOnly is the action when a volume exists in Ceph but not in DB.
	// Values: "ignore" (default) | "import"
	CephOnly string
}

ReconcilePolicy controls startup reconciliation behaviour when the DB and Ceph are out of sync.

type RetryPolicy

type RetryPolicy struct {
	MaxAttempts int           // VOLUME_RETRY_MAX_ATTEMPTS, default: 3
	InitialWait time.Duration // VOLUME_RETRY_INITIAL_WAIT, default: 500ms
	Multiplier  float64       // VOLUME_RETRY_MULTIPLIER,   default: 2.0
	MaxWait     time.Duration // VOLUME_RETRY_MAX_WAIT,     default: 10s
}

RetryPolicy controls exponential back-off for failed FSM transitions. Values are loaded from environment variables; defaults are applied when the variables are absent.

Jump to

Keyboard shortcuts

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