track

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: AGPL-3.0 Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matcher

type Matcher struct {
	Str    string
	Stderr bool
	// contains filtered or unexported fields
}

Matcher describes the matching of a given string on a certain stream (stdout or stderr)

type MatcherSet added in v1.0.0

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

MatcherSet encapsulates a set of matchers when all of them match, `done` will be closed.

func NewMatcherSet added in v1.0.0

func NewMatcherSet(matchers []Matcher, verbose bool) MatcherSet

func (*MatcherSet) Match added in v1.0.0

func (m *MatcherSet) Match(str string, stderr bool) bool

Match returns whether all matchers either: * currently match the string and stream type (stdout/stderr) * have matched previously and closes the `done` channel if so.

type Tracker

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

Tracker allows to track stdout and stderr of running commands and wait for certain messages to appear

func NewTracker

func NewTracker(cmd *exec.Cmd, logStdout, logStderr bool, prefixStdout, prefixStderr string) (*Tracker, error)

func (*Tracker) LogStderr

func (t *Tracker) LogStderr(b bool)

func (*Tracker) LogStdout

func (t *Tracker) LogStdout(b bool)

func (*Tracker) Match

func (t *Tracker) Match(matchers []Matcher, verbose bool) chan struct{}

Match creates a MatcherSet, registers it and returns a channel that will be closed when all matchers have matched

func (*Tracker) Wait

func (t *Tracker) Wait()

Wait waits until stdout and stdin are closed

Jump to

Keyboard shortcuts

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