api

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

ErrorResponse represents an error response

type JobResponse

type JobResponse struct {
	JobID string `json:"job_id"`
}

JobResponse represents a job response

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents the API server

func NewServer

func NewServer(jobManager *jobs.Manager, logger *logger.Logger) *Server

NewServer creates a new API server

func (*Server) HandleDeleteJob

func (s *Server) HandleDeleteJob(w http.ResponseWriter, r *http.Request)

HandleDeleteJob handles DELETE /api/v1/jobs/{id}

func (*Server) HandleGetJob

func (s *Server) HandleGetJob(w http.ResponseWriter, r *http.Request)

HandleGetJob handles GET /api/v1/jobs/{id}

func (*Server) HandleHealth

func (s *Server) HandleHealth(w http.ResponseWriter, r *http.Request)

HandleHealth handles GET /health

func (*Server) HandleListJobs

func (s *Server) HandleListJobs(w http.ResponseWriter, r *http.Request)

HandleListJobs handles GET /api/v1/jobs

func (*Server) HandleStartContainers

func (s *Server) HandleStartContainers(w http.ResponseWriter, r *http.Request)

HandleStartContainers handles POST /start

func (*Server) HandleStopContainers

func (s *Server) HandleStopContainers(w http.ResponseWriter, r *http.Request)

HandleStopContainers handles POST /stop

func (*Server) LoggingMiddleware

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

LoggingMiddleware logs HTTP requests with structured logging

func (*Server) RecoveryMiddleware

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

RecoveryMiddleware recovers from panics and logs them

func (*Server) Router

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

Router creates and configures the HTTP router

Jump to

Keyboard shortcuts

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