Documentation ¶
Index ¶
- type Options
- func (opts *Options) GetOptions() gocmd.Options
- func (opts *Options) GetStderrWriter() io.Writer
- func (opts *Options) GetStdoutWriter() io.Writer
- func (opts *Options) GetTick() time.Duration
- func (opts *Options) GetTimeout() time.Duration
- func (opts *Options) HasTick() bool
- func (opts *Options) HasTimeout() bool
- type Runner
- func (r *Runner) GetExitCode() int
- func (r *Runner) GetStatus() gocmd.Status
- func (r *Runner) GetStatusString() string
- func (r *Runner) GetStderrLine(sep string) string
- func (r *Runner) GetStderrLines() []string
- func (r *Runner) GetStderrReader() io.Reader
- func (r *Runner) GetStdoutLine(sep string) string
- func (r *Runner) GetStdoutLines() []string
- func (r *Runner) GetStdoutReader() io.Reader
- func (r *Runner) Run(options *Options) gocmd.Status
- func (r *Runner) SetEnv(env []string) *Runner
- func (r *Runner) SetWorkdir(workdir string) *Runner
- func (r *Runner) WriteOutput(stdout, stderr io.Writer)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { // Timeout specifies timeout for the command to complete. Command will be stooped when timeout reached. Timeout time.Duration // Tick specifies time interval which is used for command logs output - on each tick Tick time.Duration // Buffered refers to github.com/go-cmd/cmd.Options.Buffered Buffered bool // Streaming refers to github.com/go-cmd/cmd.Options.Streaming Streaming bool // StdoutWriter specifies where to write stdout StdoutWriter io.Writer // StderrWriter specifies where to write stderr StderrWriter io.Writer }
Options specifies command options
func (*Options) GetOptions ¶
GetOptions cast options to github.com/go-cmd/cmd.Options
func (*Options) GetStderrWriter ¶
GetStderrWriter is a getter
func (*Options) GetStdoutWriter ¶
GetStdoutWriter is a getter
func (*Options) GetTimeout ¶
GetTimeout gets timeout from options
func (*Options) HasTimeout ¶
HasTimeout checks whether timeout is specified
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner specifies command runner
func NewWithName ¶
NewWithName creates new runner having name and args explicitly separated as in github.com/go-cmd/cmd
func (*Runner) GetExitCode ¶
GetExitCode gets exit code. The process should be completed
func (*Runner) GetStatusString ¶
GetStatusString gets Status as a meaningful string
func (*Runner) GetStderrLine ¶
GetStderrLine gets STDERR as a single line concatenated with separator
func (*Runner) GetStderrLines ¶
GetStderrLines gets STDERR as a slice of lines
func (*Runner) GetStderrReader ¶
GetStderrReader gets STDERR as a io.Reader
func (*Runner) GetStdoutLine ¶
GetStdoutLine gets STDOUT as a single line concatenated with separator
func (*Runner) GetStdoutLines ¶
GetStdoutLines gets STDOUT as a slice of lines
func (*Runner) GetStdoutReader ¶
GetStdoutReader gets STDOUT as a io.Reader
func (*Runner) SetWorkdir ¶
SetWorkdir is a setter
func (*Runner) WriteOutput ¶
WriteOutput writes output into provided stdout and stderr writers from run app's stdout and stderr