Documentation
¶
Index ¶
- func BuildContainerRunCommand(opts *docker.RunOptions) (string, error)
- func ExecInSystem(execPath string, fullCommand string, logsBuffer *bytes.Buffer, print bool) error
- func ExecInSystemWithParams(execPath string, params []string, logsBuffer *bytes.Buffer, print bool) error
- type ShellOperator
- func (op *ShellOperator) ComposeDown() error
- func (op *ShellOperator) ComposeState() (map[string]interface{}, error)
- func (op *ShellOperator) ComposeUp() error
- func (op *ShellOperator) ContainerGetHostname(container string) (string, error)
- func (op *ShellOperator) ContainerGetPortBinding(container string, containerPort uint) (hostPort uint, err error)
- func (op *ShellOperator) ContainerIfExist(containerName string) bool
- func (op *ShellOperator) ContainerIfRunning(containerName string) bool
- func (op *ShellOperator) ContainerListMounts(containerName string) (docker.Mounts, error)
- func (op *ShellOperator) ContainerListPortPublishes(containerName string) ([]docker.PortPublish, error)
- func (op *ShellOperator) ContainerRemove(containerName string) error
- func (op *ShellOperator) ContainerRun(opts *docker.RunOptions) error
- func (op *ShellOperator) ContainerStop(containerName string) error
- func (op *ShellOperator) ImageIfExist(imageNameWithTag string) bool
- func (op *ShellOperator) ImagePull(imageNameWithTag string) error
- func (op *ShellOperator) ImageRemove(imageNameWithTag string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildContainerRunCommand ¶
func BuildContainerRunCommand(opts *docker.RunOptions) (string, error)
BuildContainerRunCommand builds the docker run command string from the given options and additional params
func ExecInSystem ¶
ExecInSystem can exec a command with a full command in system. All logs produced by command would be print to stdout and write into logsBuffer if it is not nil
func ExecInSystemWithParams ¶
func ExecInSystemWithParams(execPath string, params []string, logsBuffer *bytes.Buffer, print bool) error
ExecInSystemWithParams can exec a command with some params in system. All logs produced by command would be print to stdout and write into logsBuffer if it is not nil
Types ¶
type ShellOperator ¶
type ShellOperator struct{}
ShellOperator is an implementation of /pkg/util/docker.Operator interface by using shell commands
func (*ShellOperator) ComposeDown ¶ added in v0.9.0
func (op *ShellOperator) ComposeDown() error
func (*ShellOperator) ComposeState ¶ added in v0.9.0
func (op *ShellOperator) ComposeState() (map[string]interface{}, error)
func (*ShellOperator) ComposeUp ¶ added in v0.9.0
func (op *ShellOperator) ComposeUp() error
func (*ShellOperator) ContainerGetHostname ¶
func (op *ShellOperator) ContainerGetHostname(container string) (string, error)
func (*ShellOperator) ContainerGetPortBinding ¶
func (op *ShellOperator) ContainerGetPortBinding(container string, containerPort uint) (hostPort uint, err error)
func (*ShellOperator) ContainerIfExist ¶
func (op *ShellOperator) ContainerIfExist(containerName string) bool
func (*ShellOperator) ContainerIfRunning ¶
func (op *ShellOperator) ContainerIfRunning(containerName string) bool
func (*ShellOperator) ContainerListMounts ¶
func (op *ShellOperator) ContainerListMounts(containerName string) (docker.Mounts, error)
func (*ShellOperator) ContainerListPortPublishes ¶
func (op *ShellOperator) ContainerListPortPublishes(containerName string) ([]docker.PortPublish, error)
func (*ShellOperator) ContainerRemove ¶
func (op *ShellOperator) ContainerRemove(containerName string) error
func (*ShellOperator) ContainerRun ¶
func (op *ShellOperator) ContainerRun(opts *docker.RunOptions) error
func (*ShellOperator) ContainerStop ¶
func (op *ShellOperator) ContainerStop(containerName string) error
func (*ShellOperator) ImageIfExist ¶
func (op *ShellOperator) ImageIfExist(imageNameWithTag string) bool
func (*ShellOperator) ImagePull ¶
func (op *ShellOperator) ImagePull(imageNameWithTag string) error
func (*ShellOperator) ImageRemove ¶
func (op *ShellOperator) ImageRemove(imageNameWithTag string) error
Click to show internal directories.
Click to hide internal directories.