api

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerConfig

type ContainerConfig struct {
	Image  string            `json:"Image"`
	Cmd    []string          `json:"Cmd,omitempty"`
	Env    []string          `json:"Env,omitempty"`
	Tty    bool              `json:"Tty"`
	Labels map[string]string `json:"Labels,omitempty"`
}

type ContainerJSON

type ContainerJSON struct {
	ID              string            `json:"Id"`
	Names           []string          `json:"Names,omitempty"`
	Image           string            `json:"Image"`
	ImageID         string            `json:"ImageID,omitempty"`
	Command         string            `json:"Command"`
	Created         int64             `json:"Created"`
	State           any               `json:"State"` // string for list, object for inspect
	Status          string            `json:"Status"`
	Ports           []PortMapping     `json:"Ports"`
	Labels          map[string]string `json:"Labels,omitempty"`
	NetworkSettings *NetworkSettings  `json:"NetworkSettings,omitempty"`
	Config          *ContainerConfig  `json:"Config,omitempty"`
	HostConfig      *HostConfig       `json:"HostConfig,omitempty"`
}

type ContainerState

type ContainerState struct {
	Status     string `json:"Status"`
	Running    bool   `json:"Running"`
	Paused     bool   `json:"Paused"`
	StartedAt  string `json:"StartedAt"`
	FinishedAt string `json:"FinishedAt"`
}

type CreateContainerRequest

type CreateContainerRequest struct {
	Image      string            `json:"Image"`
	Cmd        []string          `json:"Cmd,omitempty"`
	Entrypoint []string          `json:"Entrypoint,omitempty"`
	Env        []string          `json:"Env,omitempty"`
	Tty        bool              `json:"Tty"`
	OpenStdin  bool              `json:"OpenStdin"`
	WorkingDir string            `json:"WorkingDir,omitempty"`
	Labels     map[string]string `json:"Labels,omitempty"`
	HostConfig *HostConfig       `json:"HostConfig,omitempty"`
}

type CreateContainerResponse

type CreateContainerResponse struct {
	ID       string   `json:"Id"`
	Warnings []string `json:"Warnings"`
}

type EndpointSettings

type EndpointSettings struct {
	IPAddress string `json:"IPAddress"`
	Gateway   string `json:"Gateway"`
}

type Event added in v0.6.0

type Event struct {
	Type     string     `json:"Type"`
	Action   string     `json:"Action"`
	Actor    EventActor `json:"Actor"`
	Time     int64      `json:"time"`
	TimeNano int64      `json:"timeNano"`
	Scope    string     `json:"scope"`
}

type EventActor added in v0.6.0

type EventActor struct {
	ID         string            `json:"ID"`
	Attributes map[string]string `json:"Attributes"`
}

type EventBus added in v0.6.0

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

EventBus is a simple publish/subscribe hub for Docker-compatible events.

func NewEventBus added in v0.6.0

func NewEventBus() *EventBus

func (*EventBus) Publish added in v0.6.0

func (b *EventBus) Publish(e Event)

Publish fans out an event to all subscribers without blocking.

func (*EventBus) Subscribe added in v0.6.0

func (b *EventBus) Subscribe() (<-chan Event, func())

Subscribe returns a channel that receives published events and an unsubscribe function. The channel is buffered (64) so slow consumers don't block publishers — events are dropped if the buffer is full.

type ExecConfig

type ExecConfig struct {
	AttachStdin  bool     `json:"AttachStdin"`
	AttachStdout bool     `json:"AttachStdout"`
	AttachStderr bool     `json:"AttachStderr"`
	Tty          bool     `json:"Tty"`
	Cmd          []string `json:"Cmd"`
}

type ExecCreateResponse

type ExecCreateResponse struct {
	ID string `json:"Id"`
}

type ExecStartRequest

type ExecStartRequest struct {
	Detach bool `json:"Detach"`
	Tty    bool `json:"Tty"`
}

type HostConfig

type HostConfig struct {
	Binds        []string              `json:"Binds,omitempty"`
	PortBindings map[string][]PortBind `json:"PortBindings,omitempty"`
	NetworkMode  string                `json:"NetworkMode"`
}

type ImageJSON

type ImageJSON struct {
	ID       string   `json:"Id"`
	RepoTags []string `json:"RepoTags"`
	Created  int64    `json:"Created"`
	Size     int64    `json:"Size"`
}

type InfoResponse

type InfoResponse struct {
	Containers    int    `json:"Containers"`
	Images        int    `json:"Images"`
	OSType        string `json:"OSType"`
	Arch          string `json:"Architecture"`
	Name          string `json:"Name"`
	ServerVersion string `json:"ServerVersion"`
}

type Logger added in v0.6.0

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

Logger provides rolling terminal display and file-based request logging.

func NewLogger added in v0.6.0

func NewLogger(maxShow int, logFile string) (*Logger, error)

NewLogger creates a logger that shows the last maxShow lines on the terminal and writes all entries to logFile. Pass "" for logFile to skip file logging.

func (*Logger) Close added in v0.6.0

func (l *Logger) Close()

func (*Logger) Log added in v0.6.0

func (l *Logger) Log(line string)

func (*Logger) LogWriter added in v0.6.0

func (l *Logger) LogWriter(prefix string) io.Writer

LogWriter returns an io.Writer that sends each write to the logger. Useful for redirecting runtime output (e.g., image pull progress).

type NetworkConnectRequest

type NetworkConnectRequest struct {
	Container string `json:"Container"`
}

type NetworkCreateRequest

type NetworkCreateRequest struct {
	Name   string            `json:"Name"`
	Driver string            `json:"Driver,omitempty"`
	Labels map[string]string `json:"Labels,omitempty"`
}

type NetworkJSON

type NetworkJSON struct {
	ID     string            `json:"Id"`
	Name   string            `json:"Name"`
	Driver string            `json:"Driver"`
	Scope  string            `json:"Scope"`
	Labels map[string]string `json:"Labels"`
}

type NetworkSettings

type NetworkSettings struct {
	Networks map[string]*EndpointSettings `json:"Networks,omitempty"`
}

type PortBind

type PortBind struct {
	HostIP   string `json:"HostIp"`
	HostPort string `json:"HostPort"`
}

type PortMapping

type PortMapping struct {
	IP          string `json:"IP,omitempty"`
	PrivatePort uint16 `json:"PrivatePort"`
	PublicPort  uint16 `json:"PublicPort,omitempty"`
	Type        string `json:"Type"`
}

type Server

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

func NewServer

func NewServer(eng engine.Runtime, socketPath string) *Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(ctx context.Context) error

func (*Server) ServeHTTP

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

ServeHTTP strips the API version prefix (e.g., /v1.41/) and delegates to the mux.

func (*Server) SetLogger added in v0.6.0

func (s *Server) SetLogger(logger *Logger)

SetLogger attaches a logger to the server for request logging.

type VersionResponse

type VersionResponse struct {
	Version    string `json:"Version"`
	APIVersion string `json:"ApiVersion"`
	OS         string `json:"Os"`
	Arch       string `json:"Arch"`
	GoVersion  string `json:"GoVersion"`
}

type VolumeCreateRequest

type VolumeCreateRequest struct {
	Name   string `json:"Name"`
	Driver string `json:"Driver,omitempty"`
}

type VolumeJSON

type VolumeJSON struct {
	Name       string            `json:"Name"`
	Driver     string            `json:"Driver"`
	Mountpoint string            `json:"Mountpoint"`
	Labels     map[string]string `json:"Labels"`
}

type VolumeListResponse

type VolumeListResponse struct {
	Volumes []*VolumeJSON `json:"Volumes"`
}

Jump to

Keyboard shortcuts

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