exec

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec

func Exec(ctx context.Context, dir string, stm IOStreams, name string, arg ...string) error

Exec executes the given command and returns the output.

func ForkExec

func ForkExec(ctx context.Context, dir string, name string, arg ...string) error

ForkExec forks a new process and execs the given command. The process will be terminated when the context is canceled.

func ForkExecKill

func ForkExecKill(ctx context.Context, dir string, name string) error

ForkExecKill kills the process if it is running.

func ForkExecRestart

func ForkExecRestart(ctx context.Context, dir string, name string) error

ForkExecRestart restarts the process if it is not running.

func IsRunning

func IsRunning(ctx context.Context, dir string, name string) bool

func LookPath

func LookPath(file string) (string, error)

LookPath is a wrapper around exec.LookPath.

Types

type IOStreams

type IOStreams struct {
	// In think, os.Stdin
	In io.Reader
	// Out think, os.Stdout
	Out io.Writer
	// ErrOut think, os.Stderr
	ErrOut io.Writer
}

Jump to

Keyboard shortcuts

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