Documentation ¶
Index ¶
- type Command
- func (c *Command) Attempts() int
- func (c *Command) CurrentArgs() []string
- func (c *Command) CurrentDir() string
- func (c *Command) CurrentEnv() map[string]string
- func (c *Command) CurrentName() string
- func (c *Command) DidError() bool
- func (c *Command) DidFail() bool
- func (c *Command) Error() error
- func (c *Command) SetArgs(args []string)
- func (c *Command) SetDir(dir string)
- func (c *Command) SetEnv(env map[string]string)
- func (c *Command) SetEnvVariable(name string, value string)
- func (c *Command) SetName(name string)
- func (c *Command) String() string
- type CommandError
- type CommandRunner
- type DefaultCommandRunner
- type TextFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { Errors []error Dir string Name string Args []string Out io.Writer Err io.Writer In io.Reader Env map[string]string // contains filtered or unexported fields }
Command is a struct containing the details of an external command to be executed.
func (*Command) CurrentArgs ¶
CurrentArgs returns the current command arguments.
func (*Command) CurrentDir ¶
CurrentDir returns the current Dir.
func (*Command) CurrentEnv ¶
CurrentEnv returns the current environment variables.
func (*Command) CurrentName ¶
CurrentName returns the current name of the command.
func (*Command) DidError ¶
DidError returns a boolean if any error occurred in any execution of the command.
func (*Command) DidFail ¶
DidFail returns a boolean if the command could not complete (errored on every attempt).
func (*Command) SetArgs ¶
SetArgs Setter method for Args to enable use of interface instead of Command struct.
func (*Command) SetDir ¶
SetDir Setter method for Dir to enable use of interface instead of Command struct.
func (*Command) SetEnv ¶
SetEnv Setter method for Env to enable use of interface instead of Command struct.
func (*Command) SetEnvVariable ¶
SetEnvVariable sets an environment variable into the environment.
type CommandError ¶
type CommandError struct { Command Command Output string // contains filtered or unexported fields }
CommandError is the error object encapsulating an error from a Command.
func (CommandError) Error ¶
func (c CommandError) Error() string
type CommandRunner ¶
CommandRunner interface that wraps the RunWithoutRetry function.
type DefaultCommandRunner ¶
type DefaultCommandRunner struct { }
func (DefaultCommandRunner) RunWithoutRetry ¶
func (d DefaultCommandRunner) RunWithoutRetry(c *Command) (string, error)
RunWithoutRetry Execute the command without retrying on failure and block waiting for return values.
type TextFormat ¶
TextFormat lets use a custom text format.
func NewTextFormat ¶
func NewTextFormat() *TextFormat
NewTextFormat creates the default Jenkins X text formatter.