config

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package config provides environment-based configuration for the control plane.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Database configuration
	DatabaseDSN string

	// Authentication
	JWTSecret    string
	JWTExpiry    time.Duration
	APIKeyHeader string

	// External services
	AtticEndpoint string
	AtticToken    string // JWT token for Attic binary cache authentication
	RegistryURL   string

	// Server configuration
	APIPort  int
	GRPCPort int
	APIHost  string

	// Graceful shutdown timeout
	// **Validates: Requirements 15.2, 15.3**
	ShutdownTimeout time.Duration

	// Scheduler configuration
	Scheduler SchedulerConfig

	// Worker configuration
	Worker WorkerConfig

	// SOPS configuration for secrets encryption
	SOPS SOPSConfig
}

Config holds all configuration for the control plane.

func Load

func Load() (*Config, error)

Load reads configuration from environment variables.

func LoadWithDefaults

func LoadWithDefaults() *Config

LoadWithDefaults loads configuration with defaults for development. It does not validate required fields, useful for testing.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks that required configuration values are set.

type SOPSConfig

type SOPSConfig struct {
	// AgePublicKey is the age public key for encryption (required for API server).
	// Format: age1... (Bech32 encoded)
	AgePublicKey string
	// AgePrivateKey is the age private key for decryption (required for node agents).
	// Format: AGE-SECRET-KEY-1... (Bech32 encoded)
	AgePrivateKey string
}

SOPSConfig holds SOPS-Nix secrets encryption configuration.

type SchedulerConfig

type SchedulerConfig struct {
	HealthThreshold   time.Duration
	MaxRetries        int
	RetryBackoff      time.Duration
	DeploymentTimeout time.Duration // Timeout for deployments waiting to be scheduled
}

SchedulerConfig holds scheduler-specific configuration.

type WorkerConfig

type WorkerConfig struct {
	WorkDir        string
	PodmanSocket   string
	BuildTimeout   time.Duration
	MaxConcurrency int
}

WorkerConfig holds build worker-specific configuration.

Jump to

Keyboard shortcuts

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