containers

package
v0.0.0-...-2508dde Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package containers implements the Docker Engine API surface for container lifecycle management, translating each endpoint into Kubernetes Deployment operations via the adapter layer.

Endpoints handled:

GET    /containers/json           → docker ps / docker ps -a
POST   /containers/create         → docker run (create phase)
POST   /containers/{id}/start     → docker start
POST   /containers/{id}/stop      → docker stop
DELETE /containers/{id}           → docker rm
GET    /containers/{id}/json      → docker inspect
GET    /containers/{id}/logs      → docker logs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler holds dependencies for all container API endpoints.

func NewHandler

func NewHandler(a *adapter.KubernetesDockerAdapter, logger *zap.SugaredLogger) *Handler

NewHandler creates a Handler.

func (*Handler) Attach

func (h *Handler) Attach(w http.ResponseWriter, r *http.Request)

Attach handles POST /containers/{id}/attach.

func (*Handler) Create

func (h *Handler) Create(w http.ResponseWriter, r *http.Request)

Create handles POST /containers/create (docker run — create phase).

func (*Handler) DispatchAction

func (h *Handler) DispatchAction(w http.ResponseWriter, r *http.Request)

DispatchAction handles POST /containers/{id}/start, /stop, /restart, /wait.

func (*Handler) DispatchGet

func (h *Handler) DispatchGet(w http.ResponseWriter, r *http.Request)

DispatchGet handles GET /containers/{id}/json and GET /containers/{id}/logs.

func (*Handler) Inspect

func (h *Handler) Inspect(w http.ResponseWriter, r *http.Request)

Inspect handles GET /containers/{id}/json.

func (*Handler) List

func (h *Handler) List(w http.ResponseWriter, r *http.Request)

List handles GET /containers/json (docker ps / docker ps -a).

func (*Handler) Logs

func (h *Handler) Logs(w http.ResponseWriter, r *http.Request)

Logs handles GET /containers/{id}/logs.

func (*Handler) Remove

func (h *Handler) Remove(w http.ResponseWriter, r *http.Request)

Remove handles DELETE /containers/{id}.

func (*Handler) Rename

func (h *Handler) Rename(w http.ResponseWriter, r *http.Request)

Rename handles POST /containers/{id}/rename.

func (*Handler) Restart

func (h *Handler) Restart(w http.ResponseWriter, r *http.Request)

Restart handles POST /containers/{id}/restart.

func (*Handler) Start

func (h *Handler) Start(w http.ResponseWriter, r *http.Request)

Start handles POST /containers/{id}/start.

func (*Handler) Stats

func (h *Handler) Stats(w http.ResponseWriter, r *http.Request)

Stats handles GET /containers/{id}/stats.

func (*Handler) Stop

func (h *Handler) Stop(w http.ResponseWriter, r *http.Request)

Stop handles POST /containers/{id}/stop.

func (*Handler) Wait

func (h *Handler) Wait(w http.ResponseWriter, r *http.Request)

Wait handles POST /containers/{id}/wait.

Jump to

Keyboard shortcuts

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