dockerutils

package
v0.300.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDockerContainerOnHost

func GetDockerContainerOnHost(host hosts.Host, containerName string) (dockerContainer containers.Container, err error)

func MustGetDockerContainerOnHost

func MustGetDockerContainerOnHost(host hosts.Host, containerName string) (dockerContainer containers.Container)

Types

type CommandExecutorDocker

type CommandExecutorDocker struct {
	// contains filtered or unexported fields
}

func NewCommandExecutorDocker

func NewCommandExecutorDocker() (c *CommandExecutorDocker)

func (*CommandExecutorDocker) GetCommandExecutor

func (c *CommandExecutorDocker) GetCommandExecutor() (commandExecutor commandexecutor.CommandExecutor, err error)

func (*CommandExecutorDocker) GetContainerByName

func (c *CommandExecutorDocker) GetContainerByName(containerName string) (dockerContainer containers.Container, err error)

func (*CommandExecutorDocker) GetHost

func (c *CommandExecutorDocker) GetHost() (host hosts.Host, err error)

func (*CommandExecutorDocker) GetHostDescription

func (c *CommandExecutorDocker) GetHostDescription() (hostDescription string, err error)

func (*CommandExecutorDocker) IsHostSet

func (c *CommandExecutorDocker) IsHostSet() (isSet bool)

func (*CommandExecutorDocker) KillContainerByName

func (c *CommandExecutorDocker) KillContainerByName(ctx context.Context, name string) (err error)

func (*CommandExecutorDocker) RunCommand

func (c *CommandExecutorDocker) RunCommand(ctx context.Context, runOptions *parameteroptions.RunCommandOptions) (commandOutput *commandexecutor.CommandOutput, err error)

func (*CommandExecutorDocker) RunCommandAndGetStdoutAsString

func (c *CommandExecutorDocker) RunCommandAndGetStdoutAsString(ctx context.Context, runOptions *parameteroptions.RunCommandOptions) (stdout string, err error)

func (*CommandExecutorDocker) RunContainer

func (c *CommandExecutorDocker) RunContainer(ctx context.Context, runOptions *DockerRunContainerOptions) (startedContainer containers.Container, err error)

func (*CommandExecutorDocker) SetHost

func (c *CommandExecutorDocker) SetHost(host hosts.Host) (err error)

type CommandExecutorDockerContainer

type CommandExecutorDockerContainer struct {
	// contains filtered or unexported fields
}

func NewCommandExecutorDockerContainer

func NewCommandExecutorDockerContainer() (c *CommandExecutorDockerContainer)

func (*CommandExecutorDockerContainer) GetCommandExecutor

func (c *CommandExecutorDockerContainer) GetCommandExecutor() (commandExectuor commandexecutor.CommandExecutor, err error)

func (*CommandExecutorDockerContainer) GetDocker

func (d *CommandExecutorDockerContainer) GetDocker() (docker Docker, err error)

func (*CommandExecutorDockerContainer) GetName

func (c *CommandExecutorDockerContainer) GetName() (name string, err error)

func (*CommandExecutorDockerContainer) IsRunning

func (c *CommandExecutorDockerContainer) IsRunning(ctx context.Context) (isRunning bool, err error)

func (*CommandExecutorDockerContainer) Kill

func (*CommandExecutorDockerContainer) RunCommand

func (*CommandExecutorDockerContainer) RunCommandAndGetStdoutAsString

func (c *CommandExecutorDockerContainer) RunCommandAndGetStdoutAsString(ctx context.Context, runOptions *parameteroptions.RunCommandOptions) (stdout string, err error)

func (*CommandExecutorDockerContainer) SetDocker

func (d *CommandExecutorDockerContainer) SetDocker(docker Docker) (err error)

func (*CommandExecutorDockerContainer) SetName

func (c *CommandExecutorDockerContainer) SetName(name string) (err error)

type Docker

type Docker interface {
	GetContainerByName(name string) (container containers.Container, err error)
	GetHostDescription() (hostDescription string, err error)
}

func GetCommandExecutorDocker

func GetCommandExecutorDocker(commandExecutor commandexecutor.CommandExecutor) (docker Docker, err error)

func GetCommandExecutorDockerOnHost

func GetCommandExecutorDockerOnHost(host hosts.Host) (docker Docker, err error)

func GetDockerOnHost

func GetDockerOnHost(host hosts.Host) (docker Docker, err error)

func GetLocalCommandExecutorDocker

func GetLocalCommandExecutorDocker() (docker Docker, err error)

func MustGetCommandExecutorDocker

func MustGetCommandExecutorDocker(commandExecutor commandexecutor.CommandExecutor) (docker Docker)

func MustGetCommandExecutorDockerOnHost

func MustGetCommandExecutorDockerOnHost(host hosts.Host) (docker Docker)

func MustGetDockerOnHost

func MustGetDockerOnHost(host hosts.Host) (docker Docker)

func MustGetLocalCommandExecutorDocker

func MustGetLocalCommandExecutorDocker() (docker Docker)

func MustGetcommandExecutorDocker

func MustGetcommandExecutorDocker(commandExecutor commandexecutor.CommandExecutor) (docker Docker)

type DockerRunContainerOptions

type DockerRunContainerOptions struct {
	ImageName               string
	Name                    string
	Command                 []string
	Ports                   []string
	Mounts                  []string
	KeepStoppedContainer    bool
	Verbose                 bool
	VerboseDockerRunCommand bool
	UseHostNet              bool
}

func NewDockerRunContainerOptions

func NewDockerRunContainerOptions() (d *DockerRunContainerOptions)

func (*DockerRunContainerOptions) GetCommand

func (d *DockerRunContainerOptions) GetCommand() (command []string, err error)

func (*DockerRunContainerOptions) GetImageName

func (o *DockerRunContainerOptions) GetImageName() (imageName string, err error)

func (*DockerRunContainerOptions) GetKeepStoppedContainer

func (d *DockerRunContainerOptions) GetKeepStoppedContainer() (keepStoppedContainer bool, err error)

func (*DockerRunContainerOptions) GetMounts

func (d *DockerRunContainerOptions) GetMounts() (mounts []string, err error)

func (*DockerRunContainerOptions) GetName

func (o *DockerRunContainerOptions) GetName() (name string, err error)

func (*DockerRunContainerOptions) GetPorts

func (d *DockerRunContainerOptions) GetPorts() (ports []string, err error)

func (*DockerRunContainerOptions) GetUseHostNet

func (d *DockerRunContainerOptions) GetUseHostNet() (useHostNet bool, err error)

func (*DockerRunContainerOptions) GetVerbose

func (d *DockerRunContainerOptions) GetVerbose() (verbose bool, err error)

func (*DockerRunContainerOptions) GetVerboseDockerRunCommand

func (d *DockerRunContainerOptions) GetVerboseDockerRunCommand() (verboseDockerRunCommand bool, err error)

func (*DockerRunContainerOptions) MustGetCommand

func (d *DockerRunContainerOptions) MustGetCommand() (command []string)

func (*DockerRunContainerOptions) MustGetImageName

func (d *DockerRunContainerOptions) MustGetImageName() (imageName string)

func (*DockerRunContainerOptions) MustGetKeepStoppedContainer

func (d *DockerRunContainerOptions) MustGetKeepStoppedContainer() (keepStoppedContainer bool)

func (*DockerRunContainerOptions) MustGetMounts

func (d *DockerRunContainerOptions) MustGetMounts() (mounts []string)

func (*DockerRunContainerOptions) MustGetName

func (d *DockerRunContainerOptions) MustGetName() (name string)

func (*DockerRunContainerOptions) MustGetPorts

func (d *DockerRunContainerOptions) MustGetPorts() (ports []string)

func (*DockerRunContainerOptions) MustGetUseHostNet

func (d *DockerRunContainerOptions) MustGetUseHostNet() (useHostNet bool)

func (*DockerRunContainerOptions) MustGetVerbose

func (d *DockerRunContainerOptions) MustGetVerbose() (verbose bool)

func (*DockerRunContainerOptions) MustGetVerboseDockerRunCommand

func (d *DockerRunContainerOptions) MustGetVerboseDockerRunCommand() (verboseDockerRunCommand bool)

func (*DockerRunContainerOptions) MustSetCommand

func (d *DockerRunContainerOptions) MustSetCommand(command []string)

func (*DockerRunContainerOptions) MustSetImageName

func (d *DockerRunContainerOptions) MustSetImageName(imageName string)

func (*DockerRunContainerOptions) MustSetKeepStoppedContainer

func (d *DockerRunContainerOptions) MustSetKeepStoppedContainer(keepStoppedContainer bool)

func (*DockerRunContainerOptions) MustSetMounts

func (d *DockerRunContainerOptions) MustSetMounts(mounts []string)

func (*DockerRunContainerOptions) MustSetName

func (d *DockerRunContainerOptions) MustSetName(name string)

func (*DockerRunContainerOptions) MustSetPorts

func (d *DockerRunContainerOptions) MustSetPorts(ports []string)

func (*DockerRunContainerOptions) MustSetUseHostNet

func (d *DockerRunContainerOptions) MustSetUseHostNet(useHostNet bool)

func (*DockerRunContainerOptions) MustSetVerbose

func (d *DockerRunContainerOptions) MustSetVerbose(verbose bool)

func (*DockerRunContainerOptions) MustSetVerboseDockerRunCommand

func (d *DockerRunContainerOptions) MustSetVerboseDockerRunCommand(verboseDockerRunCommand bool)

func (*DockerRunContainerOptions) SetCommand

func (d *DockerRunContainerOptions) SetCommand(command []string) (err error)

func (*DockerRunContainerOptions) SetImageName

func (d *DockerRunContainerOptions) SetImageName(imageName string) (err error)

func (*DockerRunContainerOptions) SetKeepStoppedContainer

func (d *DockerRunContainerOptions) SetKeepStoppedContainer(keepStoppedContainer bool) (err error)

func (*DockerRunContainerOptions) SetMounts

func (d *DockerRunContainerOptions) SetMounts(mounts []string) (err error)

func (*DockerRunContainerOptions) SetName

func (d *DockerRunContainerOptions) SetName(name string) (err error)

func (*DockerRunContainerOptions) SetPorts

func (d *DockerRunContainerOptions) SetPorts(ports []string) (err error)

func (*DockerRunContainerOptions) SetUseHostNet

func (d *DockerRunContainerOptions) SetUseHostNet(useHostNet bool) (err error)

func (*DockerRunContainerOptions) SetVerbose

func (d *DockerRunContainerOptions) SetVerbose(verbose bool) (err error)

func (*DockerRunContainerOptions) SetVerboseDockerRunCommand

func (d *DockerRunContainerOptions) SetVerboseDockerRunCommand(verboseDockerRunCommand bool) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL