exechelper

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: Apache-2.0 Imports: 10 Imported by: 9

Documentation

Index

Constants

View Source
const (
	DefaultExitCodeOnError = 128
)

Variables

This section is empty.

Functions

func DoHeadless

func DoHeadless(command []string, env map[string]string) (int, error)

func Lookup added in v0.3.1

func Lookup(bin string, extraLookupPaths []string) (string, error)

func Prepare

func Prepare(
	ctx context.Context,
	command, extraPaths []string,
	tty bool,
	env map[string]string,
) (*exec.Cmd, error)

Prepare an unstarted exec.Cmd

Types

type Cmd added in v0.3.1

type Cmd struct {
	ExecCmd *exec.Cmd
	// contains filtered or unexported fields
}

func Do

func Do(s Spec) (*Cmd, error)

Do execute command directly in host

func (*Cmd) Release added in v0.3.1

func (c *Cmd) Release() error

Release process if wait was not called and you want to terminate it

func (*Cmd) Resize added in v0.3.1

func (c *Cmd) Resize(cols, rows int64) error

Resize tty windows if was created with tty enabled

func (*Cmd) Wait added in v0.3.1

func (c *Cmd) Wait() (int, error)

Wait until command exited

type Spec

type Spec struct {
	Context context.Context

	Env     map[string]string
	Command []string

	ExtraLookupPaths []string

	Stdin          io.Reader
	Stdout, Stderr io.Writer

	Tty            bool
	OnTtyCopyError func(err error)
}

Jump to

Keyboard shortcuts

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