Help us shape the future of Go! Take the 2026 Go Developer Survey

runner

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package runner abstracts command execution so scans can run for real or in dry-run mode without sending any network traffic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendCommandLog

func AppendCommandLog(path string, command Command) error

AppendCommandLog records the command line of every executed step. The file holds full command lines including auth headers (Cookie/Authorization), so it is created 0600 to keep credentials away from other local users.

Types

type Command

type Command struct {
	Name       string
	Args       []string
	Dir        string
	Env        []string
	StdoutFile string
	StderrFile string
	Timeout    time.Duration
}

type CommandResult

type CommandResult struct {
	Command  Command
	ExitCode int
	Duration time.Duration
}

type DryRunExecutor

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

func NewDryRunExecutor

func NewDryRunExecutor(verbose bool) *DryRunExecutor

func (*DryRunExecutor) Run

func (e *DryRunExecutor) Run(ctx context.Context, command Command) (*CommandResult, error)

type Executor

type Executor interface {
	Run(ctx context.Context, command Command) (*CommandResult, error)
}

type RealExecutor

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

func NewRealExecutor

func NewRealExecutor(verbose bool) *RealExecutor

func (*RealExecutor) Run

func (e *RealExecutor) Run(ctx context.Context, command Command) (*CommandResult, error)

Jump to

Keyboard shortcuts

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