Documentation
¶
Index ¶
- type Executor
- func (e *Executor) CaptureStderr(buf *bytes.Buffer) *Executor
- func (e *Executor) CaptureStdout(buf *bytes.Buffer) *Executor
- func (e *Executor) Cmd() *exec.Cmd
- func (e *Executor) ConsumeLines(r io.Reader, fn func(l string))
- func (e *Executor) EnableLive() *Executor
- func (e *Executor) OpenStdinPipe() *Executor
- func (e *Executor) ProcessWait()
- func (e *Executor) Run(_ context.Context) error
- func (e *Executor) SetupStreamHandlers() error
- func (e *Executor) Start() error
- func (e *Executor) StderrBytes() []byte
- func (e *Executor) StdoutBytes() []byte
- func (e *Executor) Stop()
- func (e *Executor) WaitError() error
- func (e *Executor) WithMatchHandler(fn func(pattern string) string) *Executor
- func (e *Executor) WithMatchers(matchers ...*utils.ByteSequenceMatcher) *Executor
- func (e *Executor) WithStderrHandler(stderrHandler func(l string))
- func (e *Executor) WithStderrSplitter(fn bufio.SplitFunc) *Executor
- func (e *Executor) WithStdoutHandler(stdoutHandler func(l string))
- func (e *Executor) WithStdoutSplitter(fn bufio.SplitFunc) *Executor
- func (e *Executor) WithTimeout(timeout time.Duration) *Executor
- func (e *Executor) WithWaitHandler(waitHandler func(error)) *Executor
- type Session
- type Stopable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor struct {
Session *Session
Live bool
StdinPipe bool
Stdin io.WriteCloser
Matchers []*utils.ByteSequenceMatcher
MatchHandler func(pattern string) string
StdoutBuffer *bytes.Buffer
StdoutSplitter bufio.SplitFunc
StdoutHandler func(l string)
StderrBuffer *bytes.Buffer
StderrSplitter bufio.SplitFunc
StderrHandler func(l string)
WaitHandler func(err error)
// contains filtered or unexported fields
}
func (*Executor) EnableLive ¶
func (*Executor) OpenStdinPipe ¶
func (*Executor) ProcessWait ¶
func (e *Executor) ProcessWait()
func (*Executor) SetupStreamHandlers ¶
func (*Executor) StderrBytes ¶
func (*Executor) StdoutBytes ¶
func (*Executor) WithMatchHandler ¶
func (*Executor) WithMatchers ¶
func (e *Executor) WithMatchers(matchers ...*utils.ByteSequenceMatcher) *Executor
func (*Executor) WithStderrHandler ¶
func (*Executor) WithStderrSplitter ¶
func (*Executor) WithStdoutHandler ¶
func (*Executor) WithStdoutSplitter ¶
func (*Executor) WithWaitHandler ¶
type Session ¶
type Session struct {
Stopables []Stopable
}
var DefaultSession *Session
func NewSession ¶
func NewSession() *Session
func (*Session) RegisterStoppable ¶
Click to show internal directories.
Click to hide internal directories.