effect

package
v1.69.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 6 Imported by: 50

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandExecutor

type CommandExecutor struct{}

CommandExecutor is an implementation of Executor that uses exec.Command and runs the command without a TTY.

func (CommandExecutor) Execute

func (CommandExecutor) Execute(execution Execution) error

type Execution

type Execution struct {

	// Command is the command to run.
	Command string

	// Args is the arguments to the command.
	Args []string

	// Dir is the working directory the command is run in.  Defaults to the current working directory.
	Dir string

	// Environment is the environment variables that the command is run with.  Defaults to current environment.
	Env []string

	// Stdin is the Reader to use for stdin.
	Stdin io.Reader

	// Stdout is the Writer to use for stdout.
	Stdout io.Writer

	// Stderr is the Writer to use for stderr.
	Stderr io.Writer
}

Execution is information about a command to run.

type Executor

type Executor interface {

	// Execute executes the command described in the Execution.
	Execute(execution Execution) error
}

Executor is the interface for types that can execute an Execution.

func NewExecutor

func NewExecutor() Executor

NewExecutor creates a new Executor. If the buildpack is currently running in a TTY, returns a TTY-aware Executor.

type TTYExecutor

type TTYExecutor struct{}

TTYExecutor is an implementation of Executor that uses exec.Command and runs the command with a TTY.

func (TTYExecutor) Execute

func (t TTYExecutor) Execute(execution Execution) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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