Documentation
¶
Overview ¶
Package api is the engine's API, compatible with a subset of the Docker Engine API (v1.47): what wctrd serves on a unix socket, and the client wctr speaks it with. Shapes follow the v1.47 OpenAPI document (see docs/REFERENCES.md); only the fields the engine fills are present.
The client side (types, Client, stdcopy) imports neither the daemon nor wazero, so the wctr command builds for wasip1.
Index ¶
- Constants
- Variables
- func DefaultHost() string
- func Demux(stdout, stderr io.Writer, r io.Reader) error
- func DeviceCaps(reqs []DeviceRequest) ([]string, error)
- func IsNotFound(err error) bool
- func WriteFrame(w io.Writer, stream byte, p []byte) error
- type BlkioEntry
- type BlkioStats
- type CPUStats
- type Client
- func (c *Client) Attach(ctx context.Context, id string) (io.ReadCloser, error)
- func (c *Client) Changes(ctx context.Context, id string) ([]FilesystemChange, error)
- func (c *Client) Commit(ctx context.Context, o CommitOptions) (string, error)
- func (c *Client) Containers(ctx context.Context, all bool, filters ...Filters) ([]ContainerSummary, error)
- func (c *Client) CopyFrom(ctx context.Context, container, p string) (io.ReadCloser, error)
- func (c *Client) CopyTo(ctx context.Context, container, dir string, tarball io.Reader) error
- func (c *Client) Create(ctx context.Context, name string, req ContainerCreateRequest) (ContainerCreateResponse, error)
- func (c *Client) DiskUsage(ctx context.Context) (SystemDataUsage, error)
- func (c *Client) Events(ctx context.Context, o EventsOptions, fn func(EventMessage) error) error
- func (c *Client) HTTP() (*http.Client, string)
- func (c *Client) ImageInspect(ctx context.Context, ref string) (json.RawMessage, error)
- func (c *Client) ImageLoad(ctx context.Context, layoutTar io.Reader) ([]string, error)
- func (c *Client) ImageTag(ctx context.Context, source, repo, tag string) error
- func (c *Client) Images(ctx context.Context) ([]ImageSummary, error)
- func (c *Client) Inspect(ctx context.Context, id string) (json.RawMessage, error)
- func (c *Client) Kill(ctx context.Context, id string) error
- func (c *Client) Logs(ctx context.Context, id string, follow bool) (io.ReadCloser, error)
- func (c *Client) NetworkConnect(ctx context.Context, network, container string, aliases []string) error
- func (c *Client) NetworkCreate(ctx context.Context, o NetworkCreateRequest) (NetworkCreateResponse, error)
- func (c *Client) NetworkDisconnect(ctx context.Context, network, container string, force bool) error
- func (c *Client) NetworkInspect(ctx context.Context, ref string) (json.RawMessage, error)
- func (c *Client) NetworkPrune(ctx context.Context, labels []string) (NetworkPruneResponse, error)
- func (c *Client) NetworkRemove(ctx context.Context, ref string) error
- func (c *Client) Networks(ctx context.Context, filters ...Filters) ([]Network, error)
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) PruneContainers(ctx context.Context) (ContainerPruneResponse, error)
- func (c *Client) PruneImages(ctx context.Context, all bool) (ImagePruneResponse, error)
- func (c *Client) Pull(ctx context.Context, ref string, progress func(JSONMessage)) error
- func (c *Client) Remove(ctx context.Context, id string, force bool) error
- func (c *Client) RemoveImage(ctx context.Context, ref string, force bool) ([]ImageDeleteResponseItem, error)
- func (c *Client) Restart(ctx context.Context, id string) error
- func (c *Client) Start(ctx context.Context, id string) error
- func (c *Client) StatPath(ctx context.Context, container, p string) (ContainerPathStat, error)
- func (c *Client) Stats(ctx context.Context, id string, stream bool, fn func(ContainerStats) error) error
- func (c *Client) Stop(ctx context.Context, id string) error
- func (c *Client) Version(ctx context.Context) (SystemVersion, error)
- func (c *Client) VolumeCreate(ctx context.Context, o VolumeCreateOptions) (Volume, error)
- func (c *Client) VolumeInspect(ctx context.Context, name string) (json.RawMessage, error)
- func (c *Client) VolumeRemove(ctx context.Context, name string, force bool) error
- func (c *Client) Volumes(ctx context.Context, filters ...Filters) ([]Volume, error)
- func (c *Client) VolumesPrune(ctx context.Context, all bool) (VolumePruneResponse, error)
- func (c *Client) Wait(ctx context.Context, id, condition string) (*Waiter, error)
- type CommitOptions
- type CommitResponse
- type ContainerConfig
- type ContainerCreateRequest
- type ContainerCreateResponse
- type ContainerInspect
- type ContainerPathStat
- type ContainerPruneResponse
- type ContainerState
- type ContainerStats
- type ContainerSummary
- type ContainerWaitExitError
- type ContainerWaitResponse
- type DeviceRequest
- type EndpointSettings
- type ErrDaemon
- type ErrorResponse
- type EventActor
- type EventMessage
- type EventsOptions
- type FilesystemChange
- type Filters
- type HealthConfig
- type HostConfig
- type ImageConfig
- type ImageDeleteResponseItem
- type ImageHistory
- type ImageInspect
- type ImagePruneResponse
- type ImageSummary
- type JSONMessage
- type JSONMsgError
- type MemoryStats
- type MountPoint
- type Network
- type NetworkConnectRequest
- type NetworkCreateRequest
- type NetworkCreateResponse
- type NetworkDisconnectRequest
- type NetworkEndpoint
- type NetworkIPAM
- type NetworkPruneResponse
- type NetworkSettings
- type NetworkingConfig
- type PidsStats
- type StorageUsage
- type StrSlice
- type SystemDataUsage
- type SystemVersion
- type Volume
- type VolumeCreateOptions
- type VolumeListResponse
- type VolumePruneResponse
- type VolumeUsage
- type Waiter
- type WctrStatsInfo
Constants ¶
const ( StreamStdin byte = 0 StreamStdout byte = 1 StreamStderr byte = 2 )
Stream types of the multiplexed stream.
const ( APIVersion = "1.47" MinAPIVersion = "1.24" )
APIVersion is the version the server speaks; MinAPIVersion the oldest it accepts in a /vX.Y prefix.
const DefaultSocket = "/var/run/wctr.sock"
DefaultSocket is where wctrd listens and wctr connects when neither -H nor WCTR_HOST says otherwise.
const HostEnv = "WCTR_HOST"
HostEnv names the environment variable that overrides the daemon host.
Variables ¶
var ErrBadFrame = errors.New("malformed multiplexed stream")
ErrBadFrame is returned for a malformed multiplexed stream.
var KnownCaps = []string{"gpu"}
KnownCaps are the device capabilities this engine grants: "gpu" opens the local GPU to a container's host modules (wasi:webgpu, wasi-nn on the GPU).
Functions ¶
func DefaultHost ¶
func DefaultHost() string
DefaultHost is $WCTR_HOST if set, else unix:// + DefaultSocket.
func Demux ¶
Demux copies a multiplexed stream to stdout and stderr (stdin frames, type 0, go to stdout as the format says), until EOF.
func DeviceCaps ¶ added in v0.13.0
func DeviceCaps(reqs []DeviceRequest) ([]string, error)
DeviceCaps turns device requests into the capabilities they grant. A request is satisfied by the first of its OR alternatives made only of known capabilities; a request none of whose alternatives is known, or one naming a driver or device IDs (there are no host devices to pick in a WebAssembly engine), is refused.
Types ¶
type BlkioEntry ¶ added in v0.7.0
type BlkioEntry struct {
Major uint64 `json:"major"`
Minor uint64 `json:"minor"`
Op string `json:"op"`
Value uint64 `json:"value"`
}
BlkioEntry is one blkio counter.
type BlkioStats ¶ added in v0.7.0
type BlkioStats struct {
IOServiceBytesRecursive []BlkioEntry `json:"io_service_bytes_recursive"`
}
BlkioStats carries the bytes written to the container's filesystem.
type CPUStats ¶ added in v0.7.0
type CPUStats struct {
CPUUsage struct {
TotalUsage uint64 `json:"total_usage"`
} `json:"cpu_usage"`
SystemCPUUsage uint64 `json:"system_cpu_usage"`
OnlineCPUs uint32 `json:"online_cpus"`
}
CPUStats is Docker's CPU block, left at zero here.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client speaks the API to a daemon.
func NewClientWith ¶
NewClientWith uses a caller-provided HTTP client and base URL (tests, and later the browser's own transport).
func (*Client) Attach ¶ added in v0.5.0
Attach streams a container's output from now until its next exit, multiplexed (see Demux). Attach before Start so nothing is missed.
func (*Client) Commit ¶ added in v0.12.0
Commit makes an image of a container's changes; it returns the image ID.
func (*Client) Containers ¶
func (c *Client) Containers(ctx context.Context, all bool, filters ...Filters) ([]ContainerSummary, error)
Containers lists containers, with optional filters (label, name, id, status, network).
func (*Client) CopyFrom ¶ added in v0.12.0
CopyFrom returns a tar of the container's path p (GET /containers/{id}/archive); the caller closes it.
func (*Client) CopyTo ¶ added in v0.12.0
CopyTo extracts a tar into the container's directory dir (PUT /containers/{id}/archive).
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, name string, req ContainerCreateRequest) (ContainerCreateResponse, error)
Create creates a container.
func (*Client) DiskUsage ¶ added in v0.4.0
func (c *Client) DiskUsage(ctx context.Context) (SystemDataUsage, error)
DiskUsage is GET /system/df.
func (*Client) Events ¶ added in v0.6.0
func (c *Client) Events(ctx context.Context, o EventsOptions, fn func(EventMessage) error) error
Events streams events to fn until the stream ends (until reached, the context cancelled, or the daemon cutting off a slow reader).
func (*Client) HTTP ¶ added in v0.12.0
HTTP returns the client's HTTP client and the engine's base URL, API version included ("http://wctr/v1.47"), for a caller that speaks the API itself (a builder streaming a context).
func (*Client) ImageInspect ¶
ImageInspect inspects an image.
func (*Client) ImageLoad ¶ added in v0.12.0
ImageLoad sends an OCI image layout tar (POST /images/load) and returns the "Loaded image…" lines.
func (*Client) Images ¶
func (c *Client) Images(ctx context.Context) ([]ImageSummary, error)
Images lists images.
func (*Client) NetworkConnect ¶ added in v0.14.0
func (c *Client) NetworkConnect(ctx context.Context, network, container string, aliases []string) error
NetworkConnect puts a container on a network, answering there to its name and aliases.
func (*Client) NetworkCreate ¶ added in v0.10.0
func (c *Client) NetworkCreate(ctx context.Context, o NetworkCreateRequest) (NetworkCreateResponse, error)
NetworkCreate makes an in-engine network.
func (*Client) NetworkDisconnect ¶ added in v0.14.0
func (c *Client) NetworkDisconnect(ctx context.Context, network, container string, force bool) error
NetworkDisconnect takes a container off a network.
func (*Client) NetworkInspect ¶ added in v0.10.0
NetworkInspect inspects a network.
func (*Client) NetworkPrune ¶ added in v0.14.0
NetworkPrune removes the networks no container uses (those whose labels match every label filter: "k", "k=v", "k!=v").
func (*Client) NetworkRemove ¶ added in v0.10.0
NetworkRemove removes a network.
func (*Client) Networks ¶ added in v0.10.0
Networks lists networks, with optional filters (label, name, id, driver).
func (*Client) PruneContainers ¶ added in v0.4.0
func (c *Client) PruneContainers(ctx context.Context) (ContainerPruneResponse, error)
PruneContainers removes every stopped container.
func (*Client) PruneImages ¶ added in v0.4.0
PruneImages removes dangling images, or with all every image no container uses.
func (*Client) Pull ¶
Pull pulls ref, calling progress for each message; an error message in the stream is returned as an error.
func (*Client) RemoveImage ¶
func (c *Client) RemoveImage(ctx context.Context, ref string, force bool) ([]ImageDeleteResponseItem, error)
RemoveImage removes an image.
func (*Client) StatPath ¶ added in v0.14.0
StatPath describes the container's path p without copying it (HEAD /containers/{id}/archive).
func (*Client) Stats ¶ added in v0.7.0
func (c *Client) Stats(ctx context.Context, id string, stream bool, fn func(ContainerStats) error) error
Stats reads a container's stats once (stream false) or once a second until fn returns an error or the stream ends.
func (*Client) Stop ¶ added in v0.5.0
Stop stops a running container and returns once it has exited; a container that is not running is not an error (the daemon answers 304).
func (*Client) Version ¶
func (c *Client) Version(ctx context.Context) (SystemVersion, error)
Version returns the daemon's version.
func (*Client) VolumeCreate ¶ added in v0.8.0
VolumeCreate makes a volume (or returns the existing one).
func (*Client) VolumeInspect ¶ added in v0.8.0
VolumeInspect inspects a volume.
func (*Client) VolumeRemove ¶ added in v0.8.0
VolumeRemove removes a volume.
func (*Client) Volumes ¶ added in v0.8.0
Volumes lists volumes, with optional filters (name, label, dangling).
func (*Client) VolumesPrune ¶ added in v0.8.0
VolumesPrune removes unused anonymous volumes, or with all every unused one.
type CommitOptions ¶ added in v0.12.0
type CommitOptions struct {
Container, Repo, Tag, Comment, Author string
Changes []string
Config *ImageConfig
}
CommitOptions is POST /commit's query; Config, when set, is the body.
type CommitResponse ¶ added in v0.12.0
type CommitResponse struct {
ID string `json:"Id"`
}
CommitResponse is the reply to POST /commit.
type ContainerConfig ¶
type ContainerConfig struct {
Image string `json:"Image"`
Cmd StrSlice `json:"Cmd"`
Entrypoint StrSlice `json:"Entrypoint"`
Env []string `json:"Env"`
WorkingDir string `json:"WorkingDir"`
Labels map[string]string `json:"Labels"`
Tty bool `json:"Tty"`
}
ContainerConfig is the create body's container part.
type ContainerCreateRequest ¶
type ContainerCreateRequest struct {
ContainerConfig
HostConfig HostConfig `json:"HostConfig"`
NetworkingConfig *NetworkingConfig `json:"NetworkingConfig,omitempty"`
}
ContainerCreateRequest is the body of POST /containers/create.
type ContainerCreateResponse ¶
ContainerCreateResponse is the reply to POST /containers/create.
type ContainerInspect ¶
type ContainerInspect struct {
ID string `json:"Id"`
Created string `json:"Created"`
Path string `json:"Path"`
Args []string `json:"Args"`
State ContainerState `json:"State"`
Image string `json:"Image"`
Name string `json:"Name"`
RestartCount int `json:"RestartCount"`
Driver string `json:"Driver"`
Platform string `json:"Platform"`
SizeRw int64 `json:"SizeRw"`
Config ContainerConfig `json:"Config"`
HostConfig HostConfig `json:"HostConfig"`
Mounts []MountPoint `json:"Mounts"`
// NetworkSettings has the address while the container runs.
NetworkSettings NetworkSettings `json:"NetworkSettings"`
}
ContainerInspect is GET /containers/{id}/json (a subset).
type ContainerPathStat ¶ added in v0.14.0
type ContainerPathStat struct {
Name string `json:"name"`
Size int64 `json:"size"`
Mode uint32 `json:"mode"`
Mtime string `json:"mtime"`
LinkTarget string `json:"linkTarget"`
}
ContainerPathStat is the base64 JSON of the X-Docker-Container-Path-Stat header (GET and HEAD /containers/{id}/archive).
type ContainerPruneResponse ¶ added in v0.4.0
type ContainerPruneResponse struct {
ContainersDeleted []string `json:"ContainersDeleted"`
SpaceReclaimed int64 `json:"SpaceReclaimed"`
}
ContainerPruneResponse is POST /containers/prune.
type ContainerState ¶
type ContainerState struct {
Status string `json:"Status"`
Running bool `json:"Running"`
Paused bool `json:"Paused"`
Restarting bool `json:"Restarting"`
OOMKilled bool `json:"OOMKilled"`
Dead bool `json:"Dead"`
Pid int `json:"Pid"`
ExitCode int `json:"ExitCode"`
Error string `json:"Error"`
StartedAt string `json:"StartedAt"`
FinishedAt string `json:"FinishedAt"`
}
ContainerState is the State of an inspect reply.
type ContainerStats ¶ added in v0.7.0
type ContainerStats struct {
Read string `json:"read"`
Preread string `json:"preread"`
Name string `json:"name"`
ID string `json:"id"`
PidsStats PidsStats `json:"pids_stats"`
MemoryStats MemoryStats `json:"memory_stats"`
CPUStats CPUStats `json:"cpu_stats"`
PreCPUStats CPUStats `json:"precpu_stats"`
BlkioStats BlkioStats `json:"blkio_stats"`
Wctr WctrStatsInfo `json:"wctr"`
}
ContainerStats is one reading of GET /containers/{id}/stats, in Docker's shape: memory_stats usage/limit, blkio writes, pids. CPU fields are present and zero: a wasm guest gives the engine no CPU accounting, which Wctr.CPU says rather than leaving it to be read as idle.
type ContainerSummary ¶
type ContainerSummary struct {
ID string `json:"Id"`
Names []string `json:"Names"`
Image string `json:"Image"`
ImageID string `json:"ImageID"`
Command string `json:"Command"`
Created int64 `json:"Created"`
Ports []any `json:"Ports"`
SizeRw int64 `json:"SizeRw,omitempty"`
Labels map[string]string `json:"Labels"`
State string `json:"State"`
Status string `json:"Status"`
HostConfig struct {
NetworkMode string `json:"NetworkMode"`
} `json:"HostConfig"`
}
ContainerSummary is one entry of GET /containers/json.
type ContainerWaitExitError ¶
type ContainerWaitExitError struct {
Message string `json:"Message"`
}
ContainerWaitExitError is the error part of a wait reply.
type ContainerWaitResponse ¶
type ContainerWaitResponse struct {
StatusCode int64 `json:"StatusCode"`
Error *ContainerWaitExitError `json:"Error"`
}
ContainerWaitResponse is the reply to POST /containers/{id}/wait.
type DeviceRequest ¶ added in v0.13.0
type DeviceRequest struct {
Driver string `json:"Driver,omitempty"`
Count int `json:"Count,omitempty"`
DeviceIDs []string `json:"DeviceIDs,omitempty"`
Capabilities [][]string `json:"Capabilities,omitempty"`
Options map[string]string `json:"Options,omitempty"`
}
DeviceRequest is Docker's request for devices from a device driver. Capabilities is an OR list of AND lists ([["gpu"]]).
func GPURequest ¶ added in v0.13.0
func GPURequest() DeviceRequest
GPURequest is what run --gpu sends: every device with the capability "gpu" (Docker's --gpus all).
type EndpointSettings ¶ added in v0.10.0
type EndpointSettings struct {
Aliases []string `json:"Aliases"`
NetworkID string `json:"NetworkID,omitempty"`
IPAddress string `json:"IPAddress"`
IPPrefixLen int `json:"IPPrefixLen,omitempty"`
DNSNames []string `json:"DNSNames"`
}
EndpointSettings is a container's place on one network.
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
ErrorResponse is the body of every error.
type EventActor ¶ added in v0.6.0
EventActor is what emitted an event.
type EventMessage ¶ added in v0.6.0
type EventMessage struct {
Type string `json:"Type"`
Action string `json:"Action"`
Actor EventActor `json:"Actor"`
Scope string `json:"scope"`
Time int64 `json:"time"`
TimeNano int64 `json:"timeNano"`
}
EventMessage is one line of GET /events.
type EventsOptions ¶ added in v0.6.0
EventsOptions selects events: since and until as GET /events takes them (Unix seconds, RFC 3339 or a duration back from now), filters as key → values.
type FilesystemChange ¶ added in v0.4.0
FilesystemChange is one entry of GET /containers/{id}/changes; Kind is 0 modified, 1 added, 2 deleted.
type Filters ¶ added in v0.18.0
Filters is the Engine API's filters parameter: values by key, any value of a key matching, every key applying ("label" values all apply: "k", "k=v", "k!=v"). The engine refuses a key it does not know.
type HealthConfig ¶ added in v0.12.0
type HealthConfig struct {
Test []string `json:"Test,omitempty"`
Interval int64 `json:"Interval,omitempty"`
Timeout int64 `json:"Timeout,omitempty"`
StartPeriod int64 `json:"StartPeriod,omitempty"`
StartInterval int64 `json:"StartInterval,omitempty"`
Retries int `json:"Retries,omitempty"`
}
HealthConfig is a HEALTHCHECK (durations in nanoseconds).
type HostConfig ¶
type HostConfig struct {
Memory int64 `json:"Memory"`
AutoRemove bool `json:"AutoRemove"`
// Binds are "VOLUME:/path[:ro|:rw]"; named volumes only.
Binds []string `json:"Binds,omitempty"`
// NetworkMode is the network to join ("default", "none", a name).
NetworkMode string `json:"NetworkMode,omitempty"`
// DeviceRequests asks for devices (run --gpu: one request with the
// capability "gpu").
DeviceRequests []DeviceRequest `json:"DeviceRequests,omitempty"`
}
HostConfig is the create body's host part (a subset).
type ImageConfig ¶ added in v0.12.0
type ImageConfig struct {
User string `json:"User,omitempty"`
ExposedPorts map[string]struct{} `json:"ExposedPorts,omitempty"`
Env []string `json:"Env,omitempty"`
Cmd StrSlice `json:"Cmd,omitempty"`
Entrypoint StrSlice `json:"Entrypoint,omitempty"`
Volumes map[string]struct{} `json:"Volumes,omitempty"`
WorkingDir string `json:"WorkingDir,omitempty"`
Labels map[string]string `json:"Labels,omitempty"`
StopSignal string `json:"StopSignal,omitempty"`
ArgsEscaped bool `json:"ArgsEscaped,omitempty"`
Shell []string `json:"Shell,omitempty"`
OnBuild []string `json:"OnBuild,omitempty"`
Healthcheck *HealthConfig `json:"Healthcheck,omitempty"`
}
ImageConfig is an image's run configuration as Docker's API shows it (inspect Config) and takes it (the POST /commit body).
type ImageDeleteResponseItem ¶
type ImageDeleteResponseItem struct {
Untagged string `json:"Untagged,omitempty"`
Deleted string `json:"Deleted,omitempty"`
}
ImageDeleteResponseItem is one entry of DELETE /images/{name}.
type ImageHistory ¶ added in v0.12.0
type ImageHistory struct {
Created string `json:"created,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
Author string `json:"author,omitempty"`
Comment string `json:"comment,omitempty"`
EmptyLayer bool `json:"empty_layer,omitempty"`
}
ImageHistory is one entry of an image's history.
type ImageInspect ¶
type ImageInspect struct {
ID string `json:"Id"`
RepoTags []string `json:"RepoTags"`
RepoDigests []string `json:"RepoDigests"`
Created string `json:"Created"`
Author string `json:"Author"`
Architecture string `json:"Architecture"`
Os string `json:"Os"`
Size int64 `json:"Size"`
Config ImageConfig `json:"Config"`
RootFS map[string]any `json:"RootFS"`
History []ImageHistory `json:"History,omitempty"`
Metadata map[string]any `json:"Metadata,omitempty"`
Descriptor *json.RawMessage `json:"Descriptor,omitempty"`
}
ImageInspect is GET /images/{name}/json (a subset).
type ImagePruneResponse ¶ added in v0.4.0
type ImagePruneResponse struct {
ImagesDeleted []ImageDeleteResponseItem `json:"ImagesDeleted"`
SpaceReclaimed int64 `json:"SpaceReclaimed"`
}
ImagePruneResponse is POST /images/prune.
type ImageSummary ¶
type ImageSummary struct {
ID string `json:"Id"`
ParentID string `json:"ParentId"`
RepoTags []string `json:"RepoTags"`
RepoDigests []string `json:"RepoDigests"`
Created int64 `json:"Created"`
Size int64 `json:"Size"`
Labels map[string]string `json:"Labels"`
Containers int64 `json:"Containers"`
}
ImageSummary is one entry of GET /images/json.
type JSONMessage ¶
type JSONMessage struct {
Status string `json:"status,omitempty"`
Stream string `json:"stream,omitempty"`
ID string `json:"id,omitempty"`
Error string `json:"error,omitempty"`
ErrorDetail *JSONMsgError `json:"errorDetail,omitempty"`
}
JSONMessage is one line of the POST /images/create progress stream.
type JSONMsgError ¶
type JSONMsgError struct {
Message string `json:"message"`
}
JSONMsgError is the error detail of a JSONMessage.
type MemoryStats ¶ added in v0.7.0
MemoryStats is the guest's linear memory and its limit.
type MountPoint ¶ added in v0.8.0
type MountPoint struct {
Type string `json:"Type"`
Name string `json:"Name"`
Source string `json:"Source"`
Destination string `json:"Destination"`
Driver string `json:"Driver"`
Mode string `json:"Mode"`
RW bool `json:"RW"`
}
MountPoint is one entry of an inspected container's Mounts.
type Network ¶ added in v0.10.0
type Network struct {
Name string `json:"Name"`
ID string `json:"Id"`
Created string `json:"Created"`
Scope string `json:"Scope"`
Driver string `json:"Driver"`
EnableIPv6 bool `json:"EnableIPv6"`
IPAM NetworkIPAM `json:"IPAM"`
Internal bool `json:"Internal"`
Attachable bool `json:"Attachable"`
Containers map[string]NetworkEndpoint `json:"Containers"`
Options map[string]string `json:"Options"`
Labels map[string]string `json:"Labels"`
}
Network is Docker's network object (GET /networks), a subset.
type NetworkConnectRequest ¶ added in v0.14.0
type NetworkConnectRequest struct {
Container string `json:"Container"`
EndpointConfig *EndpointSettings `json:"EndpointConfig,omitempty"`
}
NetworkConnectRequest is the body of POST /networks/{id}/connect.
type NetworkCreateRequest ¶ added in v0.10.0
type NetworkCreateRequest struct {
Name string `json:"Name"`
Driver string `json:"Driver,omitempty"`
Internal bool `json:"Internal,omitempty"`
Labels map[string]string `json:"Labels,omitempty"`
Options map[string]string `json:"Options,omitempty"`
}
NetworkCreateRequest is the body of POST /networks/create.
type NetworkCreateResponse ¶ added in v0.10.0
NetworkCreateResponse is the reply to POST /networks/create.
type NetworkDisconnectRequest ¶ added in v0.14.0
type NetworkDisconnectRequest struct {
Container string `json:"Container"`
Force bool `json:"Force,omitempty"`
}
NetworkDisconnectRequest is the body of POST /networks/{id}/disconnect.
type NetworkEndpoint ¶ added in v0.10.0
NetworkEndpoint is a container on a network.
type NetworkIPAM ¶ added in v0.10.0
type NetworkIPAM struct {
Driver string `json:"Driver"`
Config []map[string]string `json:"Config"`
}
NetworkIPAM is a network's address management.
type NetworkPruneResponse ¶ added in v0.14.0
type NetworkPruneResponse struct {
NetworksDeleted []string `json:"NetworksDeleted"`
}
NetworkPruneResponse is POST /networks/prune.
type NetworkSettings ¶ added in v0.10.0
type NetworkSettings struct {
IPAddress string `json:"IPAddress"`
Networks map[string]EndpointSettings `json:"Networks"`
}
NetworkSettings is an inspected container's networking (a subset).
type NetworkingConfig ¶ added in v0.14.0
type NetworkingConfig struct {
EndpointsConfig map[string]*EndpointSettings `json:"EndpointsConfig,omitempty"`
}
NetworkingConfig is the create body's networking part: the networks' endpoint settings by network name (only Aliases is read).
type PidsStats ¶ added in v0.7.0
type PidsStats struct {
Current uint64 `json:"current"`
}
PidsStats is the process count: 1 while running, else 0.
type StorageUsage ¶ added in v0.4.0
type StorageUsage struct {
// Kind names the store: "directory /var/lib/wctr", "IndexedDB".
Kind string `json:"Kind"`
// Usage and Quota are bytes (-1: unknown); a browser reports its
// estimate for the whole origin.
Usage int64 `json:"Usage"`
Quota int64 `json:"Quota"`
// Persistent says the browser will not evict it under pressure.
Persistent bool `json:"Persistent"`
// Error is the last failure to store the engine's state, if any.
Error string `json:"Error,omitempty"`
}
StorageUsage describes the engine's storage (see SystemDataUsage).
type StrSlice ¶
type StrSlice []string
StrSlice accepts a JSON string or array of strings, as Docker's does for Cmd and Entrypoint; null stays nil ("use the image's").
func (*StrSlice) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type SystemDataUsage ¶ added in v0.4.0
type SystemDataUsage struct {
LayersSize int64 `json:"LayersSize"`
Images []ImageSummary `json:"Images"`
Containers []ContainerSummary `json:"Containers"`
Volumes []Volume `json:"Volumes"`
BuildCache []any `json:"BuildCache"`
// Storage is this engine's own addition: where its state lives and
// how full that is. Docker clients ignore it.
Storage *StorageUsage `json:"Storage,omitempty"`
}
SystemDataUsage is GET /system/df.
type SystemVersion ¶
type SystemVersion struct {
Platform struct{ Name string } `json:"Platform"`
Version string `json:"Version"`
APIVersion string `json:"ApiVersion"`
MinAPIVersion string `json:"MinAPIVersion"`
GitCommit string `json:"GitCommit"`
GoVersion string `json:"GoVersion"`
Os string `json:"Os"`
Arch string `json:"Arch"`
KernelVersion string `json:"KernelVersion"`
BuildTime string `json:"BuildTime,omitempty"`
}
SystemVersion is GET /version.
type Volume ¶ added in v0.8.0
type Volume struct {
Name string `json:"Name"`
Driver string `json:"Driver"`
Mountpoint string `json:"Mountpoint"`
CreatedAt string `json:"CreatedAt"`
Labels map[string]string `json:"Labels"`
Scope string `json:"Scope"`
Options map[string]string `json:"Options"`
UsageData *VolumeUsage `json:"UsageData,omitempty"`
}
Volume is Docker's Volume object.
type VolumeCreateOptions ¶ added in v0.8.0
type VolumeCreateOptions struct {
Name string `json:"Name"`
Driver string `json:"Driver,omitempty"`
DriverOpts map[string]string `json:"DriverOpts,omitempty"`
Labels map[string]string `json:"Labels,omitempty"`
}
VolumeCreateOptions is the body of POST /volumes/create.
type VolumeListResponse ¶ added in v0.8.0
type VolumeListResponse struct {
Volumes []Volume `json:"Volumes"`
Warnings []string `json:"Warnings"`
}
VolumeListResponse is GET /volumes.
type VolumePruneResponse ¶ added in v0.8.0
type VolumePruneResponse struct {
VolumesDeleted []string `json:"VolumesDeleted"`
SpaceReclaimed int64 `json:"SpaceReclaimed"`
}
VolumePruneResponse is POST /volumes/prune.
type VolumeUsage ¶ added in v0.8.0
VolumeUsage is a volume's size and how many containers reference it (GET /system/df).
type Waiter ¶
type Waiter struct {
// contains filtered or unexported fields
}
Waiter is a registered wait: the daemon has acknowledged it, and Result blocks until the condition holds.
func (*Waiter) Result ¶
func (w *Waiter) Result() (ContainerWaitResponse, error)
Result blocks for the wait's answer.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package inproc carries HTTP requests to a handler in the same process, with no socket: the browser has no unix sockets, so the playground's wctr talks to its engine through this transport instead.
|
Package inproc carries HTTP requests to a handler in the same process, with no socket: the browser has no unix sockets, so the playground's wctr talks to its engine through this transport instead. |
|
Package server serves the engine's Docker Engine API subset over HTTP.
|
Package server serves the engine's Docker Engine API subset over HTTP. |