toolrunner

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Overview

Package toolrunner runs argv-based tools for the recon use case. It is the single execution primitive behind the ToolRunner port: a command is always invoked as an argv array via os/exec – NEVER a shell string – with a per-run timeout (the WHOLE process group is killed on deadline, so resolver/helper grandchildren cannot outlive the authorization window) and a hard output-size cap . It performs no scope/authorization logic itself; the caller must have passed the execution guard first.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecRunner

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

ExecRunner implements ports.ToolRunner using os/exec.

func NewExecRunner

func NewExecRunner(timeout time.Duration, maxOut int) *ExecRunner

NewExecRunner returns a runner with the given default timeout and per-stream output cap; non-positive values fall back to the package defaults.

func (*ExecRunner) Run

Run executes spec as an argv array, bounded by timeout + output cap. A non-zero exit is reported via ToolResult.ExitCode (not a Go error) so the caller still gets partial output; a missing binary, a timeout, or a cancelled context returns an error alongside whatever output was captured.

Jump to

Keyboard shortcuts

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