executor

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	// Execute executes the given command
	Execute(command string, args []string) ([]byte, error)
}

Executor is an interface for executing commands.

type LocalExecutor

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

LocalExecutor is an Executor that runs commands locally.

func NewLocalExecutor

func NewLocalExecutor(logger *slog.Logger, options ...LocalExecutorOption) *LocalExecutor

NewLocalExecutor creates a new LocalExecutor with the given options.

func (*LocalExecutor) Execute

func (e *LocalExecutor) Execute(command string, args []string) ([]byte, error)

type LocalExecutorOption

type LocalExecutorOption func(e *LocalExecutor)

LocalExecutorOption is an option for configuring a LocalExecutor.

func WithRedirect

func WithRedirect() LocalExecutorOption

WithRedirect is an option that configures the LocalExecutor to redirect the stdout and stderr of the commands to the stdout and stderr of the local process.

func WithRedirectTo

func WithRedirectTo(stdout, stderr io.Writer) LocalExecutorOption

WithRedirectTo is an option that configures the LocalExecutor to redirect the stdout and stderr of the commands to the given writers.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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