api

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 27 Imported by: 0

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:

  1. construct the *Server with its dependencies,
  2. mount unversioned routes (/health),
  3. 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, cfg config.Config, patToken string) *Server

func (*Server) Handler

func (s *Server) Handler() http.Handler

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 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 v1 implements the v1 HTTP API for the sandbox daemon.
Package v1 implements the v1 HTTP API for the sandbox daemon.

Jump to

Keyboard shortcuts

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