gexpect

package module
v0.0.0-...-a1c1112 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2016 License: MPL-2.0 Imports: 10 Imported by: 3

README

= gexpect

Expect in golang in spirit of python link:https://github.com/pexpect/pexpect[pexpect].

image:https://godoc.org/github.com/shavac/gexpect?status.svg[link="http://godoc.org/github.com/shavac/gexpect"]

toc::[]

== Installation

`go get github.com/shavac/gexpect`

== Basic Usage

See link:examples[]

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EOF     = errors.New("EOF")
	TIMEOUT = errors.New("Timeout")
)

Functions

This section is empty.

Types

type SubProcess

type SubProcess struct {
	Term *pty.Terminal

	DelayBeforeSend time.Duration
	CheckInterval   time.Duration
	Before          []byte
	After           []byte
	Match           []byte
	// contains filtered or unexported fields
}

func NewSubProcess

func NewSubProcess(name string, arg ...string) (sp *SubProcess, err error)

func (*SubProcess) Close

func (sp *SubProcess) Close() (err error)

func (*SubProcess) Echo

func (sp *SubProcess) Echo()

func (*SubProcess) Expect

func (sp *SubProcess) Expect(expreg ...*regexp.Regexp) (matchIndex int, err error)

func (*SubProcess) ExpectTimeout

func (sp *SubProcess) ExpectTimeout(timeout time.Duration, expreg ...*regexp.Regexp) (matchIndex int, err error)

func (*SubProcess) Interact

func (sp *SubProcess) Interact() (err error)

func (*SubProcess) InteractTimeout

func (sp *SubProcess) InteractTimeout(d time.Duration) (err error)

func (*SubProcess) NoEcho

func (sp *SubProcess) NoEcho()

func (*SubProcess) Read

func (sp *SubProcess) Read(b []byte) (n int, err error)

func (*SubProcess) Send

func (sp *SubProcess) Send(response string) (err error)

func (*SubProcess) SendLine

func (sp *SubProcess) SendLine(response string) (err error)

func (*SubProcess) Start

func (sp *SubProcess) Start() (err error)

func (*SubProcess) Terminate

func (sp *SubProcess) Terminate() error

func (*SubProcess) Wait

func (sp *SubProcess) Wait() error

func (*SubProcess) WaitTimeout

func (sp *SubProcess) WaitTimeout(d time.Duration) (err error)

func (*SubProcess) Write

func (sp *SubProcess) Write(b []byte) (n int, err error)

func (*SubProcess) Writeln

func (sp *SubProcess) Writeln(b []byte) (n int, err error)

type TerminatedError

type TerminatedError struct {
	Message string
}

func (TerminatedError) Error

func (e TerminatedError) Error() string

type ValueNotBindError

type ValueNotBindError struct {
	VarName string
}

func (ValueNotBindError) Error

func (e ValueNotBindError) Error() string

type ValueNotFoundError

type ValueNotFoundError struct {
	VarName string
}

func (ValueNotFoundError) Error

func (e ValueNotFoundError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL