Documentation
¶
Index ¶
- func CombinedOutput(command string, args ...string) ([]byte, error)
- func Command(cmd string, args ...string) *exec.Cmd
- func CommandContext(ctx context.Context, cmd string, args ...string) *exec.Cmd
- func GetPrependedCmd() string
- func PrependCommandsWith(prependCmd string, prependArgs ...string)
- func ResetPrependedCmd()
- type CommandRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombinedOutput ¶ added in v1.20.7
CombinedOutput calls CombinedOutput on the defined commandRunner, or the default implementation in the exec package if there's no commandRunner defined.
func Command ¶ added in v1.20.7
Command calls Command on the defined commandRunner, or the default implementation in the exec package if there's no commandRunner defined.
func CommandContext ¶ added in v1.29.0
CommandContext calls CommandContext on the defined commandRunner, or the default implementation in the exec package if there's no commandRunner defined.
func GetPrependedCmd ¶ added in v1.25.0
func GetPrependedCmd() string
GetPrependedCmd returns the prepended command if one is configured, else the empty string
func PrependCommandsWith ¶ added in v1.20.7
PrependCommandsWith updates the commandRunner singleton to have the configured prepended args and command.
func ResetPrependedCmd ¶ added in v1.25.0
func ResetPrependedCmd()
ResetPrependedCmd resets the singleton for more reliable unit testing
Types ¶
type CommandRunner ¶
type CommandRunner interface { Command(string, ...string) *exec.Cmd CommandContext(context.Context, string, ...string) *exec.Cmd CombinedOutput(string, ...string) ([]byte, error) }
CommandRunner is an interface for executing commands. It gives the option to change the way commands are run server-wide.