Documentation ¶
Overview ¶
μDocker - super-lightweight Docker client. pulling in the official client uses huge amounts of code and memory
Index ¶
- Constants
- func Client(dockerUrl string, clientCertificateLoader certificateLoader, ...) (*http.Client, string, error)
- func ClientCertificateFromEnv() (*tls.Certificate, error)
- func ContainerInspectEndpoint(containerId string) string
- func DefaultDockerSockClient() (*http.Client, string, error)
- func NetworkInspectEndpoint(networkId string) string
- type Container
- type ContainerConfig
- type ContainerHealth
- type ContainerListItem
- type ContainerState
- type Mount
- type NetworkInspectOutput
- type Node
- type NodeDescription
- type Service
- type ServiceSpec
- type ServiceSpecTaskTemplate
- type ServiceSpecTaskTemplateContainerSpec
- type Task
- type TaskNetworkAttachment
- type TaskNetworkAttachmentNetwork
- type TaskNetworkAttachmentNetworkSpec
Constants ¶
View Source
const ( ListContainersEndpoint = "/v1.24/containers/json" TasksEndpoint = "/v1.24/tasks?filters=%7B%22desired-state%22%3A%5B%22running%22%5D%7D" ServicesEndpoint = "/v1.24/services" NodesEndpoint = "/v1.24/nodes" )
View Source
const (
SwarmServiceNameLabelKey = "com.docker.swarm.service.name"
)
Variables ¶
This section is empty.
Functions ¶
func ClientCertificateFromEnv ¶
func ClientCertificateFromEnv() (*tls.Certificate, error)
func NetworkInspectEndpoint ¶
Types ¶
type Container ¶
type Container struct { Id string `json:"Id"` Name string `json:"Name"` Image string `json:"Image"` Config ContainerConfig `json:"Config"` Mounts []Mount `json:"Mounts"` }
type ContainerConfig ¶
type ContainerHealth ¶
type ContainerListItem ¶
type ContainerListItem struct { Id string `json:"Id"` Names []string `json:"Names"` Image string `json:"Image"` Labels map[string]string `json:"Labels"` State ContainerState `json:"State"` NetworkSettings struct { Networks map[string]struct { IPAddress string `json:"IPAddress"` } `json:"Networks"` } `json:"NetworkSettings"` }
stupid Docker requires "inspect" to get actually interesting details
type ContainerState ¶
type ContainerState struct { Status string `json:"Status"` // "created" | "running" | "paused" | "restarting" | "removing" | "exited" | "dead" Health *ContainerHealth `json:"Health,omitempty"` }
type NetworkInspectOutput ¶
type Node ¶
type Node struct { ID string `json:"ID"` Description NodeDescription `json:"Description"` Status struct { Addr string `json:"Addr"` } `json:"Status"` }
type NodeDescription ¶
type NodeDescription struct {
Hostname string `json:"Hostname"`
}
type Service ¶
type Service struct { ID string `json:"ID"` Spec ServiceSpec `json:"Spec"` }
type ServiceSpec ¶
type ServiceSpec struct { Name string `json:"Name"` TaskTemplate ServiceSpecTaskTemplate `json:"TaskTemplate"` Labels map[string]string `json:"Labels"` }
type ServiceSpecTaskTemplate ¶
type ServiceSpecTaskTemplate struct {
ContainerSpec ServiceSpecTaskTemplateContainerSpec `json:"ContainerSpec"`
}
type Task ¶
type Task struct { ID string `json:"ID"` ServiceID string `json:"ServiceID"` NodeID string `json:"NodeID"` NetworksAttachments []TaskNetworkAttachment `json:"NetworksAttachments"` }
type TaskNetworkAttachment ¶
type TaskNetworkAttachment struct { Network TaskNetworkAttachmentNetwork `json:"Network"` Addresses []string `json:"Addresses"` }
type TaskNetworkAttachmentNetwork ¶
type TaskNetworkAttachmentNetwork struct { ID string `json:"ID"` Spec TaskNetworkAttachmentNetworkSpec `json:"Spec"` }
type TaskNetworkAttachmentNetworkSpec ¶
type TaskNetworkAttachmentNetworkSpec struct {
Name string `json:"Name"`
}
Click to show internal directories.
Click to hide internal directories.