command

package
v0.0.0-...-0666c2b Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecManager

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

ExecManager limits the number of external commands that are running at the same time

func NewExecManager

func NewExecManager(maxConcurrency uint) *ExecManager

func (*ExecManager) Run

func (m *ExecManager) Run(ctx context.Context, logger *log.Entry, cmd *exec.Cmd) (string, error)

Run runs an exec.Cmd, capturing its output and additionally redirecting it to a logger

func (*ExecManager) RunSilently

func (m *ExecManager) RunSilently(ctx context.Context, logger *log.Entry, cmd *exec.Cmd) (string, error)

RunSilently runs an exec.Cmd, capturing its output and additionally logging it only if the command fails (or if debug logging is enabled)

Jump to

Keyboard shortcuts

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