process

package
v10.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2017 License: MPL-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package process provides a mechanism for running processes under a different user account to the current process

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

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

func NewCommand

func NewCommand(commandLine []string, workingDirectory string, env []string) (*Command, error)

func (*Command) DirectOutput

func (c *Command) DirectOutput(writer io.Writer)

func (*Command) Execute

func (c *Command) Execute() (r *Result)

func (*Command) Kill

func (c *Command) Kill() error

func (*Command) String

func (c *Command) String() string

type Result

type Result struct {
	SystemError error
	ExitError   *exec.ExitError
	Duration    time.Duration
}

func (*Result) CrashCause

func (r *Result) CrashCause() error

func (*Result) Crashed

func (r *Result) Crashed() bool

func (*Result) ExitCode

func (r *Result) ExitCode() int

Returns the exit code, or

-1 if the process has not exited
-2 if the process crashed
-3 it could not be established what happened

func (*Result) Failed

func (r *Result) Failed() bool

func (*Result) FailureCause

func (r *Result) FailureCause() *exec.ExitError

func (*Result) String

func (r *Result) String() string

func (*Result) Succeeded

func (r *Result) Succeeded() bool

Jump to

Keyboard shortcuts

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