expect

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

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

Go to latest
Published: Jan 11, 2021 License: MIT Imports: 15 Imported by: 0

README

expect

expect library for go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithoutEcho

func WithoutEcho(action func() error) error

Types

type ExpectPair

type ExpectPair struct {
	SearchStr string
	Action    func(data []byte) error
}

type ExpectSubproc

type ExpectSubproc struct {
	// contains filtered or unexported fields
}

func Command

func Command(cmd string) (*ExpectSubproc, error)

func Spawn

func Spawn(cmd string) (*ExpectSubproc, error)

func (*ExpectSubproc) Close

func (e *ExpectSubproc) Close() error

func (*ExpectSubproc) Debug

func (e *ExpectSubproc) Debug(open bool)

func (*ExpectSubproc) Expect

func (e *ExpectSubproc) Expect(searchStr string) error

func (*ExpectSubproc) ExpectMatch

func (e *ExpectSubproc) ExpectMatch(regex string) (bool, error)

ExpectMatch checks whether a textual regular expression matches happened

func (*ExpectSubproc) ExpectMulti

func (e *ExpectSubproc) ExpectMulti(pairs []ExpectPair) error

ExpectMulti test all patterns in sequence and do something according to the first matched pattern

func (*ExpectSubproc) ExpectMultiUser

func (e *ExpectSubproc) ExpectMultiUser(pairs []ExpectPair) error

ExpectMultiUser read content from stdin and test match

func (*ExpectSubproc) ExpectUser

func (e *ExpectSubproc) ExpectUser(searchStr string) error

ExpectUser read content from stdin and test match

func (*ExpectSubproc) Interact

func (e *ExpectSubproc) Interact()

func (*ExpectSubproc) ReadLine

func (e *ExpectSubproc) ReadLine() (string, error)

func (*ExpectSubproc) ReadLineUser

func (e *ExpectSubproc) ReadLineUser() (string, error)

func (*ExpectSubproc) ReadUntil

func (e *ExpectSubproc) ReadUntil(delim byte) ([]byte, error)

func (*ExpectSubproc) ReadUntilUser

func (e *ExpectSubproc) ReadUntilUser(delim byte) ([]byte, error)

ReadUnitlUser read content from stdin

func (*ExpectSubproc) Send

func (e *ExpectSubproc) Send(cmd string) error

func (*ExpectSubproc) SendLine

func (e *ExpectSubproc) SendLine(cmd string) error

func (*ExpectSubproc) SendLineUser

func (e *ExpectSubproc) SendLineUser(cmd string) error

func (*ExpectSubproc) SendUser

func (e *ExpectSubproc) SendUser(cmd string) error

func (*ExpectSubproc) Start

func (e *ExpectSubproc) Start() error

func (*ExpectSubproc) Wait

func (e *ExpectSubproc) Wait() error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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