executor

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecResult

type ExecResult struct {
	Stdout   string
	Stderr   string
	ExitCode int

	// HTTP-specific fields
	StatusCode int
	Headers    http.Header
	Body       string
}

ExecResult holds the output of a step execution.

func (*ExecResult) Output

func (r *ExecResult) Output() string

Output returns the primary output: Body for HTTP steps, Stdout for others.

type HTTPExecutor

type HTTPExecutor struct {
	Step   *runbook.HTTPStep
	Client *http.Client // nil uses http.DefaultClient
}

HTTPExecutor makes an HTTP request.

func (*HTTPExecutor) Execute

func (e *HTTPExecutor) Execute(ctx context.Context, vars map[string]string, stdout, stderr io.Writer) (*ExecResult, error)

type SSHExecutor

type SSHExecutor struct {
	Step     *runbook.SSHStep
	StepName string
}

SSHExecutor runs a command on a remote host via SSH.

func (*SSHExecutor) Execute

func (e *SSHExecutor) Execute(ctx context.Context, vars map[string]string, stdout, stderr io.Writer) (*ExecResult, error)

type ShellExecutor

type ShellExecutor struct {
	Step *runbook.ShellStep
}

ShellExecutor runs a command in the local shell.

func (*ShellExecutor) Execute

func (e *ShellExecutor) Execute(ctx context.Context, vars map[string]string, stdout, stderr io.Writer) (*ExecResult, error)

type StepExecutor

type StepExecutor interface {
	Execute(ctx context.Context, vars map[string]string, stdout, stderr io.Writer) (*ExecResult, error)
}

StepExecutor executes a single step.

func New

func New(step runbook.Step) (StepExecutor, error)

New creates the appropriate executor for a step.

Jump to

Keyboard shortcuts

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