Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidEndpoint is returned when the endpoint is not a valid URL. ErrInvalidEndpoint = errors.New("invalid endpoint") // ErrConnectionRefused is returned when the client cannot connect to the given endpoint. ErrConnectionRefused = errors.New("cannot connect to Docker endpoint") )
var ErrNoSuchImage = errors.New("no such image")
ErrNoSuchImage is error returned when the image does not exist.
Functions ¶
This section is empty.
Types ¶
type APIContainers ¶ added in v0.3.23
type APIContainers struct { ID string `json:"Id"` Image string `json:"Image,omitempty"` State string `json:"State,omitempty"` Status string `json:"Status,omitempty"` Command string `json:"Command,omitempty"` SizeRw int64 `json:"SizeRw,omitempty"` SizeRootFs int64 `json:"SizeRootFs,omitempty"` Names []string `json:"Names,omitempty"` Ports []APIPort `json:"Ports,omitempty"` Mounts []APIMount `json:"Mounts,omitempty"` Labels map[string]string `json:"Labels,omitempty"` Networks NetworkList `json:"NetworkSettings,omitempty"` }
APIContainers Docker API ListContainers 响应体切片中的容器实体
type APIImages ¶ added in v0.3.20
type APIImages struct { ID string `json:"Id"` RepoTags []string `json:"RepoTags,omitempty"` Created int64 `json:"Created,omitempty"` Size int64 `json:"Size,omitempty"` VirtualSize int64 `json:"VirtualSize,omitempty"` ParentID string `json:"ParentId,omitempty"` RepoDigests []string `json:"RepoDigests,omitempty"` Labels map[string]string `json:"Labels,omitempty"` }
APIImages represent an image returned to the ListImages call.
type APIMount ¶ added in v0.3.23
type APIMount struct { Name string `json:"Name,omitempty"` Mode string `json:"Mode,omitempty"` Source string `json:"Source,omitempty"` Driver string `json:"Driver,omitempty"` Destination string `json:"Destination,omitempty"` Propagation string `json:"Propagation,omitempty"` }
APIMount 容器的挂载点
type APIPort ¶ added in v0.3.23
type APIPort struct { Type string `json:"Type,omitempty"` PublicPort int64 `json:"publicPort,omitempty"` PrivatePort int64 `json:"privatePort,omitempty"` }
APIPort Docker API 返回的端口映射类型
type Client ¶ added in v0.3.16
type Client struct { Dialer Dialer TLSConfig *tls.Config HTTPClient *http.Client // contains filtered or unexported fields }
func NewTLSClient ¶
NewTLSClient returns a Client instance ready for TLS communications with the givens server endpoint, key and certificates, using a specific remote API version. TODO: 🚧 Under construction...
func (*Client) ListContainers ¶ added in v0.3.23
func (c *Client) ListContainers() ([]APIContainers, error)
ListContainers 返回容器切片
More: https://docs.docker.com/engine/api/v1.41/#tag/Container
func (*Client) ListImages ¶ added in v0.3.20
ListImages returns the list of available images in the server.
func (*Client) ListServices ¶ added in v0.3.18
ListServices returns a slices of services
More: https://docs.docker.com/engine/api/v1.41/#tag/Service/operation/ServiceList
func (*Client) RemoveImage ¶ added in v0.3.20
RemoveImage remove an image by its name or ID.
More: https://docs.docker.com/engine/api/v1.41/#tag/Image/operation/ImageDelete.
type ContainerNetwork ¶ added in v0.3.23
type ContainerNetwork struct { Aliases []string `json:"Aliases,omitempty"` IPPrefixLen int `json:"IPPrefixLen,omitempty"` GlobalIPv6PrefixLen int `json:"GlobalIPv6PrefixLen,omitempty"` Gateway string `json:"Gateway,omitempty"` NetworkID string `json:"NetworkID,omitempty"` IPAddress string `json:"IPAddress,omitempty"` EndpointID string `json:"EndpointID,omitempty"` MacAddress string `json:"MacAddress,omitempty"` IPv6Gateway string `json:"IPv6Gateway,omitempty"` GlobalIPv6Address string `json:"GlobalIPv6Address,omitempty"` }
ContainerNetwork 容器的网络
type NetworkList ¶ added in v0.3.23
type NetworkList struct {
Networks map[string]ContainerNetwork `json:"Networks,omitempty"`
}
NetworkList 容器的网络映射