cli

package
v24.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Args

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

Args build an icmd.Cmd struct from the specified (command and) arguments.

func BuildCmd

func BuildCmd(t testing.TB, 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 testing.TB, 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 InspectCmd

func InspectCmd(t testing.TB, 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 testing.TB, 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 WaitRun

func WaitRun(t testing.TB, 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