Documentation
¶
Overview ¶
Package commands hosts all CLI commands CTRv2 interacts with. Each command is a struct that represents a CLI command, holds caller-specified arguments, and implements an API to uniformly execute itself.
Index ¶
- type Command
- type ContainerInspect
- type ContainerPort
- type ContainerStop
- type ContextualExecutor
- type DockerCp
- type DockerExec
- type DockerInspect
- type DockerLogin
- type DockerPull
- type DockerRemove
- type DockerRun
- type DockerStop
- type DockerVersion
- type GcloudAuthServiceAccount
- type GcloudAuthTokenPrint
- type HostIpAddresses
- type NetworkCreate
- type NetworkInspect
- type NetworkList
- type NetworkRemove
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
Command is the interface of the command pattern. Only support blocking execution for now.
type ContainerInspect ¶
type ContainerInspect struct { Names []string // names (or ids) of containers to be inspected Format string // value for the --format option. e.g. {{.Id}} }
ContainerInspect represents `docker container inspect`.
type ContainerPort ¶
type ContainerPort struct {
Name string // name (or id) of the container
}
ContainerPort represents `docker container port`.
type ContainerStop ¶
type ContainerStop struct {
Names []string // names (or ids) of containers to be removed
}
ContainerStop represents `docker container stop`.
type ContextualExecutor ¶
type ContextualExecutor struct{}
ContextualExecutor executes a command using the provided context.
type DockerExec ¶
type DockerExec struct { Name string // name of container ExecCommand []string // command to be executed }
DockerExec represents `docker exec`. Example of ExecCommand: ["bash", "-c", "echo $HOME && echo $PATH"] prints the value of environment variables $HOME and $PATH inside the container.
type DockerInspect ¶
type DockerLogin ¶
type DockerLogin struct {
*api.LoginRegistryRequest
}
DockerLogin represents `docker login` and is an alias to LoginRegistryRequest
type DockerPull ¶
type DockerPull struct {
ContainerImage string // ContainerImage is the full location of an image that can directly pulled by docker
}
DockerPull represents `docker pull`
type DockerRemove ¶
type DockerRemove struct {
ContainerName string
}
DockerRemove represents `docker rm`
type DockerRun ¶
type DockerRun struct {
*api.StartContainerRequest
}
DockerRun represents `docker run` and is an alias to StartContainerRequest
type DockerStop ¶
type DockerStop struct {
ContainerName string
}
DockerStop represents `docker stop`
type GcloudAuthServiceAccount ¶
type GcloudAuthServiceAccount struct {
Args []string
}
GcloudAuthServiceAccount represents `gcloud auth activate-service-account`
type GcloudAuthTokenPrint ¶
type GcloudAuthTokenPrint struct { }
GcloudAuthTokenPrint represents `gcloud auth print-access-token`
type HostIpAddresses ¶
type HostIpAddresses struct{}
HostIpAddresses represents `hostname --all-ip-addresses`. Output is all IP addresses separated by a whitespace.
type NetworkCreate ¶
type NetworkCreate struct {
Name string // name of network to be created
}
NetworkCreate represents `docker network create`.
type NetworkInspect ¶
type NetworkInspect struct { Names []string // names (or ids) of network to be inspected Format string // value for the --format option }
NetworkInspect represents `docker network inspect`.
type NetworkList ¶
type NetworkList struct { Names []string // names (or ids) of network to be listed Format string // value for the --format option. e.g. {{.ID}} }
NetworkList represents `docker network ls`.