Documentation
¶
Index ¶
- Variables
- type Action
- type Case
- type Cmd
- type Expect
- func Spawn(prog string, arg ...string) (e *Expect, err error)
- func SpawnPTY(prog string, arg ...string) (e *Expect, err error)
- func SpawnPTYWithEnvs(envs map[string]string, prog string, arg ...string) (e *Expect, err error)
- func SpawnWithEnvs(envs map[string]string, prog string, arg ...string) (e *Expect, err error)
- func (e *Expect) Close()
- func (e *Expect) Expect(expr string, expMathed ...FnMatched) ([]byte, error)
- func (e *Expect) ExpectCases(cases ...*Case) (idx int, m []byte, err error)
- func (e *Expect) ExpectRegexp(re *regexp.Regexp, expMathed ...FnMatched) ([]byte, error)
- func (e *Expect) GetEnvs() map[string]string
- func (e *Expect) HandleStderr(stderr io.ReadCloser)
- func (e *Expect) HandleStdin(stdin io.WriteCloser)
- func (e *Expect) HandleStdout(stdout io.ReadCloser)
- func (e *Expect) RemoveColor()
- func (e *Expect) Send(s string)
- func (e *Expect) SetNotMatchedHandler(notMatched FnNotMatched)
- func (e *Expect) SetTimeout(d time.Duration)
- func (e *Expect) Wait() (exitCode int, err error)
- type FnMatched
- type FnNotMatched
- type IOHandlers
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NotFound = fmt.Errorf("not matched") TimedOut = fmt.Errorf("timed out") )
Functions ¶
This section is empty.
Types ¶
type Cmd ¶ added in v0.1.2
type Cmd struct { Exit chan struct{} // contains filtered or unexported fields }
type Expect ¶
type Expect struct {
// contains filtered or unexported fields
}
func SpawnPTYWithEnvs ¶ added in v0.2.2
func SpawnWithEnvs ¶ added in v0.2.2
func (*Expect) ExpectCases ¶
func (*Expect) ExpectRegexp ¶
func (*Expect) HandleStderr ¶
func (e *Expect) HandleStderr(stderr io.ReadCloser)
func (*Expect) HandleStdin ¶
func (e *Expect) HandleStdin(stdin io.WriteCloser)
func (*Expect) HandleStdout ¶
func (e *Expect) HandleStdout(stdout io.ReadCloser)
func (*Expect) RemoveColor ¶ added in v0.2.1
func (e *Expect) RemoveColor()
func (*Expect) SetNotMatchedHandler ¶ added in v0.2.2
func (e *Expect) SetNotMatchedHandler(notMatched FnNotMatched)
func (*Expect) SetTimeout ¶
type FnNotMatched ¶ added in v0.2.2
type IOHandlers ¶
type IOHandlers interface { HandleStdin(io.WriteCloser) HandleStdout(io.ReadCloser) HandleStderr(io.ReadCloser) GetEnvs() map[string]string }
Click to show internal directories.
Click to hide internal directories.