Versions in this module Expand all Collapse all v0 v0.0.1 Dec 15, 2020 Changes in this version + const BatchExpect + const BatchSend + const BatchSendSignal + const BatchSwitchCase + const ContinueTag + const DefaultTimeout + const FailTag + const NextTag + const NoTag + const OKTag + func Continue(s *Status) func() (Tag, *Status) + func Fail(s *Status) func() (Tag, *Status) + func LogContinue(msg string, s *Status) func() (Tag, *Status) + func Next() func() (Tag, *Status) + func OK() func() (Tag, *Status) + type BCas struct + C []Caser + func (bc *BCas) Arg() string + func (bc *BCas) Cases() []Caser + func (bc *BCas) Cmd() int + func (bc *BCas) Timeout() time.Duration + type BCasT struct + C []Caser + T int + func (bct *BCasT) Arg() string + func (bct *BCasT) Cases() []Caser + func (bct *BCasT) Cmd() int + func (bct *BCasT) Timeout() time.Duration + type BCase struct + R string + Rt int + S string + T func() (Tag, *Status) + func (b *BCase) RE() (*regexp.Regexp, error) + func (b *BCase) Retry() bool + func (b *BCase) String() string + func (b *BCase) Tag() (Tag, *Status) + type BExp struct + R string + func (be *BExp) Arg() string + func (be *BExp) Cases() []Caser + func (be *BExp) Cmd() int + func (be *BExp) Timeout() time.Duration + type BExpT struct + R string + T int + func (bt *BExpT) Arg() string + func (bt *BExpT) Cases() []Caser + func (bt *BExpT) Cmd() int + func (bt *BExpT) Timeout() time.Duration + type BSig struct + S syscall.Signal + func (bs *BSig) Arg() string + func (bs *BSig) Cases() []Caser + func (bs *BSig) Cmd() int + func (bs *BSig) Timeout() time.Duration + type BSnd struct + S string + func (bs *BSnd) Arg() string + func (bs *BSnd) Cases() []Caser + func (bs *BSnd) Cmd() int + func (bs *BSnd) Timeout() time.Duration + type BatchRes struct + Idx int + Match []string + Output string + type Batcher interface + Arg func() string + Cases func() []Caser + Cmd func() int + Timeout func() time.Duration + type Case struct + R *regexp.Regexp + Rt int + S string + T func() (Tag, *Status) + func (c *Case) RE() (*regexp.Regexp, error) + func (c *Case) Retry() bool + func (c *Case) String() string + func (c *Case) Tag() (Tag, *Status) + type Caser interface + RE func() (*regexp.Regexp, error) + Retry func() bool + String func() string + Tag func() (Tag, *Status) + type Expecter interface + Close func() error + Expect func(*regexp.Regexp, time.Duration) (string, []string, error) + ExpectBatch func([]Batcher, time.Duration) ([]BatchRes, error) + ExpectSwitchCase func([]Caser, time.Duration) (string, []string, int, error) + Send func(string) error + type GExpect struct + func Spawn(command string, timeout time.Duration, opts ...Option) (*GExpect, <-chan error, error) + func SpawnFake(b []Batcher, timeout time.Duration, opt ...Option) (*GExpect, <-chan error, error) + func SpawnGeneric(opt *GenOptions, timeout time.Duration, opts ...Option) (*GExpect, <-chan error, error) + func SpawnSSH(sshClient *ssh.Client, timeout time.Duration, opts ...Option) (*GExpect, <-chan error, error) + func SpawnSSHPTY(sshClient *ssh.Client, timeout time.Duration, term term.Termios, ...) (*GExpect, <-chan error, error) + func SpawnWithArgs(command []string, timeout time.Duration, opts ...Option) (*GExpect, <-chan error, error) + func (e *GExpect) Close() error + func (e *GExpect) Expect(re *regexp.Regexp, timeout time.Duration) (string, []string, error) + func (e *GExpect) ExpectBatch(batch []Batcher, timeout time.Duration) ([]BatchRes, error) + func (e *GExpect) ExpectSwitchCase(cs []Caser, timeout time.Duration) (string, []string, int, error) + func (e *GExpect) Options(opts ...Option) (prev Option) + func (e *GExpect) Read(p []byte) (nr int, err error) + func (e *GExpect) Send(in string) error + func (e *GExpect) SendSignal(sig os.Signal) error + func (e *GExpect) String() string + type GenOptions struct + Check func() bool + Close func() error + In io.WriteCloser + Out io.Reader + Wait func() error + type Option func(*GExpect) Option + func ChangeCheck(f func() bool) Option + func CheckDuration(d time.Duration) Option + func DebugCheck(l *log.Logger) Option + func NoCheck() Option + func PartialMatch(v bool) Option + func SendTimeout(timeout time.Duration) Option + func SetEnv(env []string) Option + func SetSysProcAttr(args *syscall.SysProcAttr) Option + func Tee(w io.WriteCloser) Option + func Verbose(v bool) Option + func VerboseWriter(w io.Writer) Option + type Status struct + func NewStatus(code codes.Code, msg string) *Status + func NewStatusf(code codes.Code, format string, a ...interface{}) *Status + func (s *Status) Err() error + func (s *Status) Error() string + type Tag int32 + type TimeoutError int + func (t TimeoutError) Error() string