runner

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSilenceBuffer

func NewSilenceBuffer(writer *gbytes.Buffer) *silenceBuffer

Types

type Config

type Config struct {
	Command           *exec.Cmd     // process to be executed
	Name              string        // prefixes all output lines
	AnsiColorCode     string        // colors the output
	StartCheck        string        // text to match to indicate successful start.
	StartCheckTimeout time.Duration // how long to wait to see StartCheck
	Cleanup           func()        // invoked once the process exits
	Stdout, Stderr    io.Writer
}

Config defines a Runner.

type Runner

type Runner struct {
	Command           *exec.Cmd
	Name              string
	AnsiColorCode     string
	StartCheck        string
	StartCheckTimeout time.Duration
	Cleanup           func()
	// contains filtered or unexported fields
}

func New

func New(config Config) *Runner

New creates a Runner from a config object. Runners must be created with New to properly initialize their internal state.

func (*Runner) Clone

func (r *Runner) Clone() *Runner

func (*Runner) ExitCode

func (r *Runner) ExitCode() int

func (*Runner) PID

func (r *Runner) PID() (string, int)

func (*Runner) Run

func (r *Runner) Run(sigChan <-chan os.Signal, ready chan<- struct{}) error

func (*Runner) Stop

func (r *Runner) Stop()

Jump to

Keyboard shortcuts

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