Documentation ¶
Index ¶
- Constants
- func ArgToCmd(ctx context.Context, args ...[]string) (cmds []*std_exec.Cmd)
- func CmdToString(cmds ...*std_exec.Cmd) string
- type CommonExecutor
- func (c CommonExecutor) Buffered(ctx context.Context, cmds ...*std_exec.Cmd) (stdout *bytes.Buffer, stderr *bytes.Buffer, res PipelineResult, err error)
- func (c CommonExecutor) Command(name string, arg ...string) *std_exec.Cmd
- func (c CommonExecutor) CommandContext(ctx context.Context, name string, arg ...string) *std_exec.Cmd
- func (c CommonExecutor) Pty(cmd *std_exec.Cmd) error
- func (c CommonExecutor) Standard(ctx context.Context, stdout io.Writer, stderr io.Writer, stdin io.Reader, ...) (res PipelineResult, err error)
- type PipelineResult
- type Result
Constants ¶
View Source
const ( SigIntDelay = 2 * time.Second SigKillDelay = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func CmdToString ¶
CmdToString stringifies an os/exec.Cmd.
Types ¶
type CommonExecutor ¶
type CommonExecutor struct{}
CommonExecutor provides a general case Executor implementation.
func (CommonExecutor) Buffered ¶
func (c CommonExecutor) Buffered(ctx context.Context, cmds ...*std_exec.Cmd) (stdout *bytes.Buffer, stderr *bytes.Buffer, res PipelineResult, err error)
Buffered returns standard output/error in addition to the exit code.
It implements an Executor behavior.
func (CommonExecutor) Command ¶
func (c CommonExecutor) Command(name string, arg ...string) *std_exec.Cmd
Command completely delegates to the os/exec method.
It implements an Executor behavior.
func (CommonExecutor) CommandContext ¶
func (c CommonExecutor) CommandContext(ctx context.Context, name string, arg ...string) *std_exec.Cmd
CommandContext completely delegates to the os/exec method.
It implements an Executor behavior.
type PipelineResult ¶
Click to show internal directories.
Click to hide internal directories.