Documentation
¶
Overview ¶
Package api wires the top-level HTTP server. It is intentionally thin — per-version routing lives in subpackages (pkg/api/v1, ...) and shared HTTP helpers live in pkg/api/apihttp. This file's job is:
- construct the *Server with its dependencies,
- mount unversioned routes (/health),
- delegate /v1/... (and any future version) to that version's RegisterRoutes function.
To add a new version: create pkg/api/vN mirroring pkg/api/v1, then add a single vN.RegisterRoutes(...) call below. Versions coexist on the same mux without modifying each other.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(logger *slog.Logger, service *service.Service, dockerClient *docker.Client, builder service.ImageBuilder, cfg config.Config, patToken string, validator controlplane.Validator) *Server
NewServer constructs the API server. validator is the second-token (non-PAT) validation path; pass controlplane.Noop().Validator (or any rejecting validator) for the open-source PAT-only behavior. A nil validator is treated as reject-all so callers can't accidentally open the door by omission.
builder is the image builder the service builds with (every surface's builds go through service.BuildImage). On the dockerd engine this is the *docker.Client; on the containerd engine the daemon passes a buildkit-backed builder. A nil builder falls back to dockerClient so existing docker-only callers are unaffected; when both are nil the build endpoints return 503 (builder not configured).
Directories
¶
| Path | Synopsis |
|---|---|
|
Package apihttp holds HTTP helpers shared by every version of the public API (pkg/api/v1, ...).
|
Package apihttp holds HTTP helpers shared by every version of the public API (pkg/api/v1, ...). |
|
Package clusterlist aggregates sandbox list reads across cluster owners.
|
Package clusterlist aggregates sandbox list reads across cluster owners. |
|
Package clusterroute holds the one cluster owner-forwarding wrapper every API surface shares.
|
Package clusterroute holds the one cluster owner-forwarding wrapper every API surface shares. |
|
Package ingressproxy implements the loopback HTTP listener that fronts wake-aware Caddy port routes.
|
Package ingressproxy implements the loopback HTTP listener that fronts wake-aware Caddy port routes. |
|
Package remotemcp serves the AerolVM MCP tools over Streamable HTTP at /mcp on sandboxd (plans/mcp-server-and-agent-cli.md §5.7, Phase 2b).
|
Package remotemcp serves the AerolVM MCP tools over Streamable HTTP at /mcp on sandboxd (plans/mcp-server-and-agent-cli.md §5.7, Phase 2b). |
|
Package runloop is a compatibility facade for the official Runloop SDKs (@runloop/api-client, runloop_api_client).
|
Package runloop is a compatibility facade for the official Runloop SDKs (@runloop/api-client, runloop_api_client). |
|
Package v1 implements the v1 HTTP API for the sandbox daemon.
|
Package v1 implements the v1 HTTP API for the sandbox daemon. |