executor

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DryRun

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

func NewDryRun

func NewDryRun() *DryRun

func (*DryRun) Log

func (e *DryRun) Log() []string

func (*DryRun) Run

func (e *DryRun) Run(ctx context.Context, cmd string, args ...string) (*Result, error)

func (*DryRun) RunShell

func (e *DryRun) RunShell(ctx context.Context, script string) (*Result, error)

func (*DryRun) RunStreaming

func (e *DryRun) RunStreaming(ctx context.Context, cmd string, stdout, stderr io.Writer, args ...string) error

func (*DryRun) SetResponse

func (e *DryRun) SetResponse(cmdPrefix string, result *Result)

type Executor

type Executor interface {
	Run(ctx context.Context, cmd string, args ...string) (*Result, error)
	RunShell(ctx context.Context, script string) (*Result, error)
}

type Local

type Local struct{}

func NewLocal

func NewLocal() *Local

func (*Local) Run

func (e *Local) Run(ctx context.Context, cmd string, args ...string) (*Result, error)

func (*Local) RunShell

func (e *Local) RunShell(ctx context.Context, script string) (*Result, error)

func (*Local) RunStreaming

func (e *Local) RunStreaming(ctx context.Context, cmd string, stdout, stderr io.Writer, args ...string) error

type Result

type Result struct {
	ExitCode int
	Stdout   string
	Stderr   string
}

func (*Result) Success

func (r *Result) Success() bool

type SSH

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

func NewSSH

func NewSSH(client *ssh.Client) *SSH

func (*SSH) Run

func (e *SSH) Run(ctx context.Context, cmd string, args ...string) (*Result, error)

func (*SSH) RunShell

func (e *SSH) RunShell(ctx context.Context, script string) (*Result, error)

func (*SSH) RunStreaming

func (e *SSH) RunStreaming(ctx context.Context, cmd string, stdout, stderr io.Writer, args ...string) error

type StreamingExecutor

type StreamingExecutor interface {
	Executor
	RunStreaming(ctx context.Context, cmd string, stdout, stderr io.Writer, args ...string) error
}

Jump to

Keyboard shortcuts

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