transport

package
v1.0.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShellQuote

func ShellQuote(value string) string

ShellQuote quotes a string for a POSIX shell command argument.

func ValueDigest

func ValueDigest(value string) string

Types

type ExecRunner

type ExecRunner struct{}

ExecRunner runs commands with os/exec and captures stdout, stderr, and exit status in the shared transport shape.

func (ExecRunner) Run

func (ExecRunner) Run(ctx context.Context, name string, args []string) (RunOutput, error)

type OperationResult

type OperationResult struct {
	Operation      string   `json:"operation"`
	Status         string   `json:"status"`
	TargetDigest   string   `json:"targetDigest"`
	Command        []string `json:"command"`
	Stdout         string   `json:"stdout,omitempty"`
	Stderr         string   `json:"stderr,omitempty"`
	ExitCode       int      `json:"exitCode"`
	TimedOut       bool     `json:"timedOut"`
	DurationMillis int64    `json:"durationMillis"`
	Error          string   `json:"error,omitempty"`
}

OperationResult is the evidence-safe receipt for one transport primitive.

type Redactor

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

Redactor removes secret material from command and output evidence.

func NewRedactor

func NewRedactor(values []string) Redactor

func (Redactor) RedactArgs

func (r Redactor) RedactArgs(args []string) []string

func (Redactor) RedactString

func (r Redactor) RedactString(value string) string

type RunOutput

type RunOutput struct {
	Stdout   []byte
	Stderr   []byte
	ExitCode int
}

RunOutput captures local command output before evidence redaction.

type Runner

type Runner interface {
	Run(ctx context.Context, name string, args []string) (RunOutput, error)
}

Runner executes a local process. Transport packages accept this interface so unit tests can exercise command construction without touching the host.

Jump to

Keyboard shortcuts

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