Documentation ¶
Index ¶
- Constants
- type CmdPlus
- func (c *CmdPlus) AppendEnv(env []string)
- func (c *CmdPlus) GetOutput() string
- func (c *CmdPlus) GetOutputChannel() (chan OutputChunk, func())
- func (c *CmdPlus) Kill() error
- func (c *CmdPlus) Run() error
- func (c *CmdPlus) SetDir(dir string)
- func (c *CmdPlus) Start() error
- func (c *CmdPlus) Wait() error
- func (c *CmdPlus) WaitForCondition(condition func(string, string) bool, duration time.Duration) error
- func (c *CmdPlus) WaitForRegexp(isValid *regexp.Regexp, duration time.Duration) error
- func (c *CmdPlus) WaitForText(text string, duration time.Duration) error
- type OutputChunk
Constants ¶
const Version = "v0.9.2"
Version of package - based on Semantic Versioning 2.0.0 http://semver.org/
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmdPlus ¶
type CmdPlus struct { Cmd *exec.Cmd StdinPipe io.WriteCloser // contains filtered or unexported fields }
CmdPlus represents a more observable exec.Cmd command
func NewCmdPlus ¶
NewCmdPlus is CmdPlus's constructor
func (*CmdPlus) AppendEnv ¶ added in v0.9.0
AppendEnv sets the environment for the CmdPlus to the current process environment appended with the given environment
func (*CmdPlus) GetOutputChannel ¶
func (c *CmdPlus) GetOutputChannel() (chan OutputChunk, func())
GetOutputChannel returns a channel that passes OutputChunk as they occur. It will immediately send an OutputChunk with an empty chunk and the full output thus far. It also returns a function that when called closes the channel
func (*CmdPlus) WaitForCondition ¶
func (c *CmdPlus) WaitForCondition(condition func(string, string) bool, duration time.Duration) error
WaitForCondition calls the given function with the latest chunk of output and the full output until it returns true returns an error if it does not match after the given duration
func (*CmdPlus) WaitForRegexp ¶
WaitForRegexp waits for the full output to match the given regex returns an error if it does not match after the given duration
type OutputChunk ¶
OutputChunk represents a chunk of output for the CmdPlus