cmdrunner

package
v1.25.5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CombinedOutput added in v1.20.7

func CombinedOutput(command string, args ...string) ([]byte, error)

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

func Command(cmd string, args ...string) *exec.Cmd

Command calls Command 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

GetPrependendCmd returns the prepended command if one is configured, else the empty string

func PrependCommandsWith added in v1.20.7

func PrependCommandsWith(prependCmd string, prependArgs ...string)

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
	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.

Jump to

Keyboard shortcuts

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