process

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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 NewDefaultExecutor

func NewDefaultExecutor(sett settings.Settings, cmd *exec.Cmd) *Executor

func NewExecutor

func NewExecutor(sett settings.Settings, sess *Session, cmd *exec.Cmd) *Executor

func (*Executor) CaptureStderr

func (e *Executor) CaptureStderr(buf *bytes.Buffer) *Executor

func (*Executor) CaptureStdout

func (e *Executor) CaptureStdout(buf *bytes.Buffer) *Executor

func (*Executor) Cmd

func (e *Executor) Cmd() *exec.Cmd

func (*Executor) ConsumeLines

func (e *Executor) ConsumeLines(r io.Reader, fn func(l string))

func (*Executor) EnableLive

func (e *Executor) EnableLive() *Executor

func (*Executor) OpenStdinPipe

func (e *Executor) OpenStdinPipe() *Executor

func (*Executor) ProcessWait

func (e *Executor) ProcessWait()

func (*Executor) Run

func (e *Executor) Run(_ context.Context) error

Run executes a command and blocks until it is finished or stopped.

func (*Executor) SetupStreamHandlers

func (e *Executor) SetupStreamHandlers() error

func (*Executor) Start

func (e *Executor) Start() error

func (*Executor) StderrBytes

func (e *Executor) StderrBytes() []byte

func (*Executor) StdoutBytes

func (e *Executor) StdoutBytes() []byte

func (*Executor) Stop

func (e *Executor) Stop()

func (*Executor) WaitError

func (e *Executor) WaitError() error

func (*Executor) WithMatchHandler

func (e *Executor) WithMatchHandler(fn func(pattern string) string) *Executor

func (*Executor) WithMatchers

func (e *Executor) WithMatchers(matchers ...*utils.ByteSequenceMatcher) *Executor

func (*Executor) WithStderrHandler

func (e *Executor) WithStderrHandler(stderrHandler func(l string))

func (*Executor) WithStderrSplitter

func (e *Executor) WithStderrSplitter(fn bufio.SplitFunc) *Executor

func (*Executor) WithStdoutHandler

func (e *Executor) WithStdoutHandler(stdoutHandler func(l string))

func (*Executor) WithStdoutSplitter

func (e *Executor) WithStdoutSplitter(fn bufio.SplitFunc) *Executor

func (*Executor) WithTimeout

func (e *Executor) WithTimeout(timeout time.Duration) *Executor

func (*Executor) WithWaitHandler

func (e *Executor) WithWaitHandler(waitHandler func(error)) *Executor

type Session

type Session struct {
	Stopables []Stopable
}
var DefaultSession *Session

func NewSession

func NewSession() *Session

func (*Session) RegisterStoppable

func (s *Session) RegisterStoppable(stopable Stopable)

func (*Session) Stop

func (s *Session) Stop()

type Stopable

type Stopable interface {
	Stop()
}

Jump to

Keyboard shortcuts

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