cli

package
v2.50.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Args

func Args(args ...string) icmd.Cmd

Args build an icmd.Cmd struct from the specified arguments

func Build

func Build(name string) icmd.Cmd

Build executes the specified docker build command

func BuildCmd

func BuildCmd(t testingT, name string, cmdOperators ...CmdOperator) *icmd.Result

BuildCmd executes the specified docker build command and expect a success

func Daemon

func Daemon(d *daemon.Daemon) func(*icmd.Cmd) func()

Daemon points to the specified daemon

func Docker

func Docker(cmd icmd.Cmd, cmdOperators ...CmdOperator) *icmd.Result

Docker executes the specified docker command

func DockerCmd

func DockerCmd(t testingT, args ...string) *icmd.Result

DockerCmd executes the specified docker command and expect a success

func Format

func Format(format string) func(*icmd.Cmd) func()

Format sets the specified format with --format flag

func InDir

func InDir(path string) func(*icmd.Cmd) func()

InDir sets the folder in which the command should be executed

func Inspect

func Inspect(name string) icmd.Cmd

Inspect executes the specified docker inspect command

func InspectCmd

func InspectCmd(t testingT, name string, cmdOperators ...CmdOperator) *icmd.Result

InspectCmd executes the specified docker inspect command and expect a success

func SetTestEnvironment

func SetTestEnvironment(env *environment.Execution)

SetTestEnvironment sets a static test environment TODO: decouple this package from environment

func WaitExited

func WaitExited(t testingT, name string, timeout time.Duration, cmdOperators ...CmdOperator)

WaitExited will wait for the specified container to state exit, subject to a maximum time limit in seconds supplied by the caller

func WaitForInspectResult

func WaitForInspectResult(t testingT, name, expr, expected string, timeout time.Duration, cmdOperators ...CmdOperator)

WaitForInspectResult waits for the specified expression to be equals to the specified expected string in the given time.

func WaitRestart

func WaitRestart(t testingT, name string, timeout time.Duration, cmdOperators ...CmdOperator)

WaitRestart will wait for the specified container to restart once

func WaitRun

func WaitRun(t testingT, name string, cmdOperators ...CmdOperator)

WaitRun will wait for the specified container to be running, maximum 5 seconds.

func WithEnvironmentVariables

func WithEnvironmentVariables(envs ...string) func(cmd *icmd.Cmd) func()

WithEnvironmentVariables sets the specified environment variables for the command to run

func WithFlags

func WithFlags(flags ...string) func(*icmd.Cmd) func()

WithFlags sets the specified flags for the command to run

func WithStdin

func WithStdin(stdin io.Reader) func(*icmd.Cmd) func()

WithStdin sets the standard input reader for the command

func WithStdout

func WithStdout(writer io.Writer) func(*icmd.Cmd) func()

WithStdout sets the standard output writer of the command

func WithTimeout

func WithTimeout(timeout time.Duration) func(cmd *icmd.Cmd) func()

WithTimeout sets the timeout for the command to run

Types

type CmdOperator

type CmdOperator func(*icmd.Cmd) func()

CmdOperator defines functions that can modify a command

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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