internal/

directory
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT

Directories

Path Synopsis
adapter
agent/collector
Package collector is the agent-side adapter that samples the LOCAL node's per-task and aggregate CPU/memory load and builds a model.AgentReport for the manager.
Package collector is the agent-side adapter that samples the LOCAL node's per-task and aggregate CPU/memory load and builds a model.AgentReport for the manager.
agent/reporter
Package reporter is the agent-side adapter that pushes a model.AgentReport to the manager's ingest endpoint over HTTP.
Package reporter is the agent-side adapter that pushes a model.AgentReport to the manager's ingest endpoint over HTTP.
dockererr
Package dockererr classifies Docker/Swarm errors shared across adapters, so the autoscaler mutation path (adapter/swarm) and the GitOps deploy path (adapter/stackdeploy) agree on which errors are transient and worth retrying.
Package dockererr classifies Docker/Swarm errors shared across adapters, so the autoscaler mutation path (adapter/swarm) and the GitOps deploy path (adapter/stackdeploy) agree on which errors are transient and worth retrying.
git
Package git implements port.GitSource with go-git.
Package git implements port.GitSource with go-git.
ingest
Package ingest is the manager-side inbound HTTP adapter that receives agent reports (POST /v1/report) and hands them to a core ReportSink.
Package ingest is the manager-side inbound HTTP adapter that receives agent reports (POST /v1/report) and hands them to a core ReportSink.
metrics
Package metrics selects and constructs the daemon's MetricsProvider based on configuration.
Package metrics selects and constructs the daemon's MetricsProvider based on configuration.
metrics/distributed
Package distributed implements port.MetricsProvider by aggregating the per-task metrics reported by the per-node agent fleet (held in the manager's agent registry).
Package distributed implements port.MetricsProvider by aggregating the per-task metrics reported by the per-node agent fleet (held in the manager's agent registry).
metrics/dockerstats
Package dockerstats implements the core MetricsProvider port using the Docker Engine per-task stats API (CPU/memory baseline, no external dependencies).
Package dockerstats implements the core MetricsProvider port using the Docker Engine per-task stats API (CPU/memory baseline, no external dependencies).
metrics/prometheus
Package prometheus implements the core MetricsProvider port using PromQL queries against a Prometheus server (custom/external metrics).
Package prometheus implements the core MetricsProvider port using PromQL queries against a Prometheus server (custom/external metrics).
observability
Package observability configures the daemon's own signals: structured logging via log/slog and (in a later milestone) the Prometheus /metrics endpoint.
Package observability configures the daemon's own signals: structured logging via log/slog and (in a later milestone) the Prometheus /metrics endpoint.
sops
Package sops implements port.SecretDecrypter over the sops/v3 library.
Package sops implements port.SecretDecrypter over the sops/v3 library.
stackapi
Package stackapi serves the read-only GitOps status surface: GET /stacks (JSON of per-stack status with on-demand drift) and a server-rendered HTML UI at GET / and /ui.
Package stackapi serves the read-only GitOps status surface: GET /stacks (JSON of per-stack status with on-demand drift) and a server-rendered HTML UI at GET / and /ui.
stackdeploy
Package stackdeploy implements port.StackDeployer.
Package stackdeploy implements port.StackDeployer.
stackrender
Package stackrender implements port.StackRenderer.
Package stackrender implements port.StackRenderer.
statsutil
Package statsutil holds the Docker container-stats computations shared by the manager's dockerstats metrics provider and the agent's local collector.
Package statsutil holds the Docker container-stats computations shared by the manager's dockerstats metrics provider and the agent's local collector.
statusstore
Package statusstore is the in-memory implementation of port.StackStatusStore.
Package statusstore is the in-memory implementation of port.StackStatusStore.
swarm
Package swarm adapts the Docker Go SDK to the core SwarmController port: listing/inspecting services and tasks, scaling, and force-updating to heal stuck tasks.
Package swarm adapts the Docker Go SDK to the core SwarmController port: listing/inspecting services and tasks, scaling, and force-updating to heal stuck tasks.
app
agentloop
Package agentloop orchestrates the agent role: on each tick it collects the local node's load and pushes it to the manager.
Package agentloop orchestrates the agent role: on each tick it collects the local node's load and pushes it to the manager.
gitopsync
Package gitopsync runs the periodic GitOps stack-sync control loop.
Package gitopsync runs the periodic GitOps stack-sync control loop.
reconciler
Package reconciler runs the periodic control loop and is the single guarded mutation path: every Swarm change (scale, force-update) passes through here and is gated by dry-run, opt-in labels, and per-service cooldown.
Package reconciler runs the periodic control loop and is the single guarded mutation path: every Swarm change (scale, force-update) passes through here and is gated by dry-run, opt-in labels, and per-service cooldown.
registry
Package registry is the manager-side store of agent reports.
Package registry is the manager-side store of agent reports.
taskerrors
Package taskerrors holds the sliding-window task-error tracker: it remembers classified task errors (deduplicated per task instance) and answers "how many errors of each class did each service have in the last N minutes".
Package taskerrors holds the sliding-window task-error tracker: it remembers classified task errors (deduplicated per task instance) and answers "how many errors of each class did each service have in the last N minutes".
Package config loads and validates daemon configuration from flags and environment (flag > env > default), and parses swarm.autoscaler.* service labels into model types.
Package config loads and validates daemon configuration from flags and environment (flag > env > default), and parses swarm.autoscaler.* service labels into model types.
core
autoscaler
Package autoscaler holds the pure horizontal-scaling decision logic: given a metric value and a service policy it computes a desired replica count and clamps it to [min, max].
Package autoscaler holds the pure horizontal-scaling decision logic: given a metric value and a service policy it computes a desired replica count and clamps it to [min, max].
compose
Package compose holds the pure compose-map transforms shared by the GitOps pipeline: secret discovery (which files a stack's secrets reference) and config/secret rotation (rename file-backed objects by content hash).
Package compose holds the pure compose-map transforms shared by the GitOps pipeline: secret discovery (which files a stack's secrets reference) and config/secret rotation (rename file-backed objects by content hash).
healer
Package healer holds the pure detection logic for tasks stuck in pending under a placement constraint after node recovery (moby/moby#42215).
Package healer holds the pure detection logic for tasks stuck in pending under a placement constraint after node recovery (moby/moby#42215).
model
Package model holds the daemon's pure domain types (service policy, scale decision, task/node views).
Package model holds the daemon's pure domain types (service policy, scale decision, task/node views).
placement
Package placement evaluates Docker Swarm placement constraints against nodes.
Package placement evaluates Docker Swarm placement constraints against nodes.
port
Package port defines the interfaces (ports) the core needs from the outside world — MetricsProvider, SwarmController, and Clock.
Package port defines the interfaces (ports) the core needs from the outside world — MetricsProvider, SwarmController, and Clock.
rebalancer
Package rebalancer decides, purely, whether load is skewed enough across nodes to warrant moving a task — the load-aware rebalancing Swarm lacks (its scheduler spreads by task count, not load).
Package rebalancer decides, purely, whether load is skewed enough across nodes to warrant moving a task — the load-aware rebalancing Swarm lacks (its scheduler spreads by task count, not load).
stackstatus
Package stackstatus holds the pure drift computation for the GitOps status API: comparing the desired replica snapshot (taken at the last render) against the live Swarm services of a stack.
Package stackstatus holds the pure drift computation for the GitOps status API: comparing the desired replica snapshot (taken at the last render) against the live Swarm services of a stack.
taskerrors
Package taskerrors classifies Swarm task status errors into a small, bounded set of classes.
Package taskerrors classifies Swarm task status errors into a small, bounded set of classes.

Jump to

Keyboard shortcuts

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