proc

package
v2.7.4-test.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommandContext = dexec.CommandContext
View Source
var SignalsToForward = []os.Signal{unix.SIGINT, unix.SIGTERM}

Functions

func IsAdmin

func IsAdmin() bool

func Run

func Run(ctx context.Context, env map[string]string, io Stdio, exe string, args ...string) error

Run will run the given executable with given args and env, wait for it to terminate, and return the result. The run will dispatch signals as appropriate for the given platform (SIGTERM and SIGINT on Unix platforms and os.Interrupt on Windows).

func Start added in v2.6.0

func Start(ctx context.Context, env map[string]string, io Stdio, exe string, args ...string) (*dexec.Cmd, error)

Start will start the given executable with given args and env,, and return the command. The signals are dispatched as appropriate for the given platform (SIGTERM and SIGINT on Unix platforms and os.Interrupt on Windows).

func StartInBackground

func StartInBackground(args ...string) error

func StartInBackgroundAsRoot

func StartInBackgroundAsRoot(ctx context.Context, args ...string) error

func Terminate added in v2.7.3

func Terminate(p *os.Process) error

func Wait added in v2.6.0

func Wait(ctx context.Context, cancel context.CancelFunc, cmd *dexec.Cmd) error

Wait will wait for the Process of the command to finish. If cancel is not nil, Wait will listen for os signals and call cancel when it receives one.

Types

type Stdio added in v2.7.2

type Stdio interface {
	InOrStdin() io.Reader
	OutOrStdout() io.Writer
	ErrOrStderr() io.Writer
}

Jump to

Keyboard shortcuts

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