Documentation
¶
Index ¶
- func Run(cmdStr string) (result string)
- type Proc
- func (p *Proc) Command() *osexec.Cmd
- func (p *Proc) Err() error
- func (p *Proc) ExitCode() int
- func (p *Proc) Exited() bool
- func (p *Proc) ID() int
- func (p *Proc) IsSuccess() bool
- func (p *Proc) Kill() *Proc
- func (p *Proc) Out() io.Reader
- func (p *Proc) Peek() *Proc
- func (p *Proc) Result() string
- func (p *Proc) StdErr() io.Reader
- func (p *Proc) StdOut() io.Reader
- func (p *Proc) SysTime() time.Duration
- func (p *Proc) UserTime() time.Duration
- func (p *Proc) Wait() *Proc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Proc ¶
type Proc struct {
// contains filtered or unexported fields
}
Proc stores process info
func RunProc ¶
RunProc creates, runs, and waits for a process to complete and return *Proc with result info. This can be followed by Proc.Result() to access to string value of the returned by process.
func StartProc ¶
StartProc creates a *Proc and starts an OS process but does not wait for it to complete.
func (*Proc) Out ¶
Out waits for cmd result and surfaces the result from both stdout and stderr in an io.Reader that can be streamed. Must be called after after Proc.StartProc, Proc.RunProc
func (*Proc) Result ¶
Result waits and copies the result of the combined stdout and stderr and returns its result as a string. Must be called after Proc.StartProc Proc.RunProc() or Proc.Run().
func (*Proc) StdErr ¶
StdErr is an io.Reader pipe for standard error Must be streamed before Proc.Wait().