exec

package
v0.4.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutionIntent

type ExecutionIntent struct {
	Via            string
	Script         []byte
	ReplaceProcess bool
	StartedChan    chan interface{}
	// contains filtered or unexported fields
}

func NewExecution

func NewExecution(via string, script []byte, cwd string) (*ExecutionIntent, error)

func (*ExecutionIntent) AddModifier

func (*ExecutionIntent) Execute

func (i *ExecutionIntent) Execute() (*ExecutionResult, error)

func (*ExecutionIntent) ImportEnv

func (i *ExecutionIntent) ImportEnv(env map[string]string)

type ExecutionResult

type ExecutionResult struct {
	ScriptPath string
	Output     []byte
	ExitCode   int
	Env        map[string]string
}

type Process

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

func NewProcess

func NewProcess(cmd *exec.Cmd) *Process

func (*Process) Start

func (p *Process) Start() (*io.PipeReader, *io.PipeReader, error)

func (*Process) Wait

func (p *Process) Wait() error

type StdinReader

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

Reading directly from STDIN when executing multiple processes creates issues, as STDIN read is blocking and you can't cancel it. Instead, this is the only place we read from STDIN, and we direct the byte stream to the io.Reader returned by Claim().

func NewStdinReader

func NewStdinReader() *StdinReader

func (*StdinReader) Claim

func (r *StdinReader) Claim() io.ReadCloser

func (*StdinReader) Stop

func (r *StdinReader) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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