Documentation
¶
Index ¶
- type CommandExecutor
- func (c *CommandExecutor) ExecuteCommand(command string, arg ...string) error
- func (*CommandExecutor) ExecuteCommandResidentBinary(timeout time.Duration, command string, arg ...string) error
- func (*CommandExecutor) ExecuteCommandWithCombinedOutput(command string, arg ...string) (string, error)
- func (*CommandExecutor) ExecuteCommandWithEnv(env []string, command string, arg ...string) error
- func (*CommandExecutor) ExecuteCommandWithOutput(command string, arg ...string) (string, error)
- func (*CommandExecutor) ExecuteCommandWithOutputFile(command, outfileArg string, arg ...string) (string, error)
- func (*CommandExecutor) ExecuteCommandWithOutputFileTimeout(timeout time.Duration, command, outfileArg string, arg ...string) (string, error)
- func (*CommandExecutor) ExecuteCommandWithTimeout(timeout time.Duration, command string, arg ...string) (string, error)
- type Executor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandExecutor ¶
type CommandExecutor struct { }
CommandExecutor is the type of the Executor
func (*CommandExecutor) ExecuteCommand ¶
func (c *CommandExecutor) ExecuteCommand(command string, arg ...string) error
ExecuteCommand starts a process and wait for its completion
func (*CommandExecutor) ExecuteCommandResidentBinary ¶
func (*CommandExecutor) ExecuteCommandWithCombinedOutput ¶
func (*CommandExecutor) ExecuteCommandWithCombinedOutput(command string, arg ...string) (string, error)
ExecuteCommandWithCombinedOutput executes a command with combined output
func (*CommandExecutor) ExecuteCommandWithEnv ¶
func (*CommandExecutor) ExecuteCommandWithEnv(env []string, command string, arg ...string) error
ExecuteCommandWithEnv starts a process with env variables and wait for its completion
func (*CommandExecutor) ExecuteCommandWithOutput ¶
func (*CommandExecutor) ExecuteCommandWithOutput(command string, arg ...string) (string, error)
ExecuteCommandWithOutput executes a command with output
func (*CommandExecutor) ExecuteCommandWithOutputFile ¶
func (*CommandExecutor) ExecuteCommandWithOutputFile(command, outfileArg string, arg ...string) (string, error)
ExecuteCommandWithOutputFile executes a command with output on a file #nosec G307 Calling defer to close the file without checking the error return is not a risk for a simple file open and close
func (*CommandExecutor) ExecuteCommandWithOutputFileTimeout ¶
func (*CommandExecutor) ExecuteCommandWithOutputFileTimeout(timeout time.Duration, command, outfileArg string, arg ...string) (string, error)
ExecuteCommandWithOutputFileTimeout Same as ExecuteCommandWithOutputFile but with a timeout limit. #nosec G307 Calling defer to close the file without checking the error return is not a risk for a simple file open and close
func (*CommandExecutor) ExecuteCommandWithTimeout ¶
func (*CommandExecutor) ExecuteCommandWithTimeout(timeout time.Duration, command string, arg ...string) (string, error)
ExecuteCommandWithTimeout starts a process and wait for its completion with timeout.
type Executor ¶
type Executor interface { ExecuteCommand(command string, arg ...string) error ExecuteCommandWithEnv(env []string, command string, arg ...string) error ExecuteCommandWithOutput(command string, arg ...string) (string, error) ExecuteCommandWithCombinedOutput(command string, arg ...string) (string, error) ExecuteCommandWithOutputFile(command, outfileArg string, arg ...string) (string, error) ExecuteCommandWithOutputFileTimeout(timeout time.Duration, command, outfileArg string, arg ...string) (string, error) ExecuteCommandWithTimeout(timeout time.Duration, command string, arg ...string) (string, error) ExecuteCommandResidentBinary(timeout time.Duration, command string, arg ...string) error }
Executor is the main interface for all the exec commands