config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 9 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 {
	Network   NetworkConfig   `yaml:"network"`
	Worker    WorkerConfig    `yaml:"worker"`
	Resources ResourceConfig  `yaml:"resources"`
	Telemetry TelemetryConfig `yaml:"telemetry"`
}

Config is the strict daemon bootstrap contract. The daemon fails fast if any required field is missing or malformed.

func Load

func Load(path string) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type NetworkConfig

type NetworkConfig struct {
	ControlSocket string `yaml:"control_socket"`
	DataBind      string `yaml:"data_bind"`
}

type ResourceConfig

type ResourceConfig struct {
	MinWorkers     int     `yaml:"min_workers"`
	MaxWorkers     int     `yaml:"max_workers"`
	MemoryLimitMB  int64   `yaml:"memory_limit_mb"`
	CPULimitCores  float64 `yaml:"cpu_limit_cores"`
	PIDsLimit      int64   `yaml:"pids_limit"`
	TTL            string  `yaml:"ttl"`
	HealthInterval string  `yaml:"health_interval"`
	WorkerReuse    bool    `yaml:"worker_reuse"`

	// InsecureSandbox enables reduced sandboxing for local development.
	// This should not be enabled in production.
	InsecureSandbox bool `yaml:"insecure_sandbox"`
}

func (ResourceConfig) HealthIntervalDuration

func (r ResourceConfig) HealthIntervalDuration() time.Duration

func (ResourceConfig) MemoryLimitBytes

func (r ResourceConfig) MemoryLimitBytes() int64

func (ResourceConfig) TTLDuration

func (r ResourceConfig) TTLDuration() time.Duration

type TelemetryConfig

type TelemetryConfig struct {
	LogFormat   string `yaml:"log_format"`
	MetricsPath string `yaml:"metrics_path"`
}

type WorkerConfig

type WorkerConfig struct {
	Command               []string `yaml:"command"`
	Env                   []string `yaml:"env"`
	HealthPath            string   `yaml:"health_path"`
	StartTimeout          string   `yaml:"start_timeout"`
	StartHealthCheckDelay string   `yaml:"start_health_check_delay"`
}

func (WorkerConfig) StartHealthCheckDelayDuration

func (w WorkerConfig) StartHealthCheckDelayDuration() time.Duration

func (WorkerConfig) StartTimeoutDuration

func (w WorkerConfig) StartTimeoutDuration() time.Duration

Jump to

Keyboard shortcuts

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