Documentation
¶
Overview ¶
Package orchestrator implements a DAG-based service dependency graph for ordered startup of databases, mock servers, and developer applications.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DAG ¶
DAG is a directed acyclic graph of nodes.
func (*DAG) Execute ¶
Execute starts all nodes in topological order, waiting for health checks between tiers. It returns a cleanup function to stop all started processes.
func (*DAG) TopologicalSort ¶
TopologicalSort returns execution tiers: each tier contains nodes that can be started in parallel once all nodes in previous tiers are healthy.
type DependsOnEntry ¶
type DependsOnEntry struct {
Name string `yaml:"name"`
Condition string `yaml:"condition"` // "service_healthy" or "service_started"
}
DependsOnEntry references another node and a readiness condition.
type HealthcheckConfig ¶
type HealthcheckConfig struct {
// HTTP endpoint to poll (e.g., "http://localhost:8080/health")
HTTP string `yaml:"http"`
// TCP address to probe (e.g., "localhost:5432")
TCP string `yaml:"tcp"`
// Interval between checks
Interval time.Duration `yaml:"interval"`
// Timeout for each check attempt
Timeout time.Duration `yaml:"timeout"`
// Number of consecutive successes required
Retries int `yaml:"retries"`
}
HealthcheckConfig defines how to verify a service is ready.
type Node ¶
type Node struct {
Name string
Type NodeType
DependsOn []string // names of nodes this depends on
Healthcheck HealthcheckConfig
Port int // resolved port (after conflict resolution)
Runtime Runtime
Command []string
Env map[string]string
Dir string // Working directory for host process execution (set by include resolver for multirepo)
// contains filtered or unexported fields
}
Node is a single unit of work in the DAG.
type ServiceConfig ¶
type ServiceConfig struct {
Name string `yaml:"name"`
Runtime Runtime `yaml:"runtime"`
Command []string `yaml:"command"`
DependsOn []DependsOnEntry `yaml:"depends_on"`
Healthcheck HealthcheckConfig `yaml:"healthcheck"`
Port int `yaml:"port"`
Env map[string]string `yaml:"env"`
}
ServiceConfig defines a developer application in devx.yaml.