Documentation ¶
Overview ¶
Package exec wraps os/exec to add a little error sanitization and standardization around process return codes and a channel-based cancel mechanism
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmdRunResult ¶
func NewCmdRunResultWithErr ¶
func NewCmdRunResultWithErr(err error) CmdRunResult
func (*CmdRunResult) AttachErrorf ¶
func (r *CmdRunResult) AttachErrorf(msg string, err error)
func (CmdRunResult) ErrorStr ¶
func (r CmdRunResult) ErrorStr() string
func (CmdRunResult) IsEmpty ¶ added in v0.52.0
func (r CmdRunResult) IsEmpty() bool
func (CmdRunResult) WithFriendlyYAMLStrings ¶
func (r CmdRunResult) WithFriendlyYAMLStrings() CmdRunResult
type CmdRunner ¶ added in v0.52.0
type CmdRunner interface { Run(*exec.Cmd) error RunWithCancel(cmd *exec.Cmd, cancelCh chan struct{}) error }
CmdRunner allows to run commands on the OS. All commands running within kapp-controller should happen through an instance of this interface so that they can be intercepted and potentially modified in kctrl when running kapp-controller locally.
type Flag ¶
func NewFlagFromString ¶
type FlagSet ¶ added in v0.52.0
type FlagSet struct {
// contains filtered or unexported fields
}
func NewFlagSet ¶ added in v0.52.0
type PlainCmdRunner ¶ added in v0.52.0
type PlainCmdRunner struct{}
PlainCmdRunner implements CmdRunner interface by simply running exec.Cmd.
func NewPlainCmdRunner ¶ added in v0.52.0
func NewPlainCmdRunner() PlainCmdRunner
NewPlainCmdRunner returns a new PlainCmdRunner.
func (PlainCmdRunner) Run ¶ added in v0.52.0
func (PlainCmdRunner) Run(cmd *exec.Cmd) error
Run executes exec.Cmd.
func (PlainCmdRunner) RunWithCancel ¶ added in v0.52.0
func (PlainCmdRunner) RunWithCancel(cmd *exec.Cmd, cancelCh chan struct{}) error
RunWithCancel executes exec.Cmd. Kills execution immediately if value is read from cancelCh.