command

package
v0.14.4 Latest Latest
Warning

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

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

Documentation

Overview

Package command implements functionality to run a command for probes.

This package is used by the external and browser probe types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	CmdLine                []string
	EnvVars                []string
	WorkDir                string
	ProcessStreamingOutput func([]byte)
	// ProcessStderr, if set, is called for each stderr line (in addition to
	// the usual logging). It lets callers inspect stderr while streaming, e.g.
	// to classify known failure signatures. Only used in streaming mode. The
	// passed slice's backing array is reused on the next scan (same as
	// ProcessStreamingOutput / bufio.Scanner), so callers must not retain it
	// without copying.
	ProcessStderr   func([]byte)
	RawStderrOutput bool

	// We create a goroutine to wait for child processes to finish. This field
	// dictates how long will that goroutine wait for child processes to finish
	// before giving up. This is to avoid unbounded number of goroutines in case
	// child processes misbehave.
	ChildProcessWaitTime time.Duration
}

func (*Command) Execute

func (c *Command) Execute(ctx context.Context, l *logger.Logger) (string, error)

Jump to

Keyboard shortcuts

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