process

package
v0.68.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Process

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

func New

func New(path string, params []string) *Process

func NewWithEnvs added in v0.37.1

func NewWithEnvs(path string, params []string, envs []string) *Process

func (*Process) CountOutput added in v0.68.0

func (p *Process) CountOutput(pattern string) int

CountOutput returns how many times pattern appears in the current accumulated output.

func (*Process) Done added in v0.68.0

func (p *Process) Done() <-chan struct{}

Done returns a channel that is closed when the process exits.

func (*Process) ErrorOutput

func (p *Process) ErrorOutput() string

func (*Process) Output added in v0.68.0

func (p *Process) Output() string

func (*Process) SetBeforeStopHandler

func (p *Process) SetBeforeStopHandler(fn func())

func (*Process) Start

func (p *Process) Start() error

func (*Process) StdOutput

func (p *Process) StdOutput() string

func (*Process) Stop

func (p *Process) Stop() error

func (*Process) WaitForOutput added in v0.68.0

func (p *Process) WaitForOutput(pattern string, count int, timeout time.Duration) error

WaitForOutput polls the combined process output until the pattern is found count time(s) or the timeout is reached. It also returns early if the process exits.

type SafeBuffer added in v0.68.0

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

SafeBuffer is a thread-safe wrapper around bytes.Buffer. It is safe to call Write and String concurrently.

func (*SafeBuffer) String added in v0.68.0

func (b *SafeBuffer) String() string

func (*SafeBuffer) Write added in v0.68.0

func (b *SafeBuffer) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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