Documentation
¶
Index ¶
- Constants
- func RegisterRoutes(mux *http.ServeMux, h *Handler, mounts Mounts) []string
- type Dependencies
- type Handler
- func (h *Handler) GetDeploymentRunHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetDeploymentRunsHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetProjectsApiHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetScheduledJobsHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetStacksApiHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HealthCheckHandler(w http.ResponseWriter, _ *http.Request)
- func (h *Handler) ProjectActionApiHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ProjectApiHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) StackActionApiHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) StackApiHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) TriggerPollHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) TriggerScheduledJobHandler(w http.ResponseWriter, r *http.Request)
- type HealthFailureReporter
- type Mounts
- type RunOperations
Constants ¶
const ( // APIPath is the root path for authenticated REST operations. APIPath = "/v1/api" // WebhookPath is the root path for deployment webhooks. WebhookPath = "/v1/webhook" // HealthPath is the unauthenticated health endpoint. HealthPath = "/v1/health" // MCPPath is the stateless MCP transport endpoint. MCPPath = "/mcp" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dependencies ¶ added in v0.115.0
type Dependencies struct {
AppConfig *app.Config `validate:"required,nostructlevel"`
Logger *logger.Logger `validate:"required,nostructlevel"`
DockerCLI command.Cli `validate:"required,nostructlevel"`
Contexts *docker.ContextRegistry `validate:"required,nostructlevel"`
Runs RunOperations `validate:"required,nostructlevel"`
HealthFailureReporter HealthFailureReporter `validate:"required"`
}
Dependencies contains the runtime services required by the REST API handlers.
type Handler ¶ added in v0.115.0
type Handler struct {
// contains filtered or unexported fields
}
Handler adapts REST requests to Docker and control-plane operations.
func NewHandler ¶ added in v0.115.0
func NewHandler(dependencies Dependencies) (*Handler, error)
NewHandler validates dependencies and constructs the REST API adapter.
func (*Handler) GetDeploymentRunHandler ¶ added in v0.115.0
func (h *Handler) GetDeploymentRunHandler(w http.ResponseWriter, r *http.Request)
GetDeploymentRunHandler returns one tracked deployment run by job ID.
func (*Handler) GetDeploymentRunsHandler ¶ added in v0.115.0
func (h *Handler) GetDeploymentRunsHandler(w http.ResponseWriter, r *http.Request)
GetDeploymentRunsHandler lists tracked deployment runs using optional filters.
func (*Handler) GetProjectsApiHandler ¶ added in v0.115.0
func (h *Handler) GetProjectsApiHandler(w http.ResponseWriter, r *http.Request)
GetProjectsApiHandler lists Compose projects in the requested Docker context.
func (*Handler) GetScheduledJobsHandler ¶ added in v0.115.0
func (h *Handler) GetScheduledJobsHandler(w http.ResponseWriter, r *http.Request)
GetScheduledJobsHandler lists scheduled jobs for an optional context and stack.
func (*Handler) GetStacksApiHandler ¶ added in v0.115.0
func (h *Handler) GetStacksApiHandler(w http.ResponseWriter, r *http.Request)
GetStacksApiHandler lists Swarm stacks in the requested Docker context.
func (*Handler) HealthCheckHandler ¶ added in v0.115.0
func (h *Handler) HealthCheckHandler(w http.ResponseWriter, _ *http.Request)
HealthCheckHandler handles health check requests and reports Docker API availability.
func (*Handler) ProjectActionApiHandler ¶ added in v0.115.0
func (h *Handler) ProjectActionApiHandler(w http.ResponseWriter, r *http.Request)
ProjectActionApiHandler applies a lifecycle action to a Compose project.
func (*Handler) ProjectApiHandler ¶ added in v0.115.0
func (h *Handler) ProjectApiHandler(w http.ResponseWriter, r *http.Request)
ProjectApiHandler returns or removes a single Compose project.
func (*Handler) StackActionApiHandler ¶ added in v0.115.0
func (h *Handler) StackActionApiHandler(w http.ResponseWriter, r *http.Request)
StackActionApiHandler applies an action to matching services in a Swarm stack.
func (*Handler) StackApiHandler ¶ added in v0.115.0
func (h *Handler) StackApiHandler(w http.ResponseWriter, r *http.Request)
StackApiHandler returns or removes a single Swarm stack.
func (*Handler) TriggerPollHandler ¶ added in v0.115.0
func (h *Handler) TriggerPollHandler(w http.ResponseWriter, r *http.Request)
TriggerPollHandler validates and runs poll configurations from the request body.
func (*Handler) TriggerScheduledJobHandler ¶ added in v0.115.0
func (h *Handler) TriggerScheduledJobHandler(w http.ResponseWriter, r *http.Request)
TriggerScheduledJobHandler starts a scheduled job synchronously or asynchronously.
type HealthFailureReporter ¶ added in v0.115.0
type HealthFailureReporter func( w http.ResponseWriter, log *slog.Logger, jobID string, failureType error, cause error, )
HealthFailureReporter preserves application-level health failure reporting without coupling the API package to the webhook implementation.
type RunOperations ¶ added in v0.115.0
type RunOperations interface {
List(limit int, trigger, status string) []controlplane.Run
Get(jobID string) (controlplane.Run, bool)
ListScheduledJobs(ctx context.Context, contextName, stackName string) ([]scheduler.JobInfo, error)
TriggerScheduledJob(ctx context.Context, jobID, contextName, jobName, stackName string, wait bool) (string, error)
TriggerPoll(ctx context.Context, configs []poll.Config, wait bool, log *slog.Logger) (string, error)
}
RunOperations is the control-plane surface consumed by the REST API.