process

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(dir string, command string, args []string) (string, bool, error)

Runs a command and gets the result.

Types

type Process

type Process struct {
	Label      string
	ExecPath   string
	Args       []string
	Pid        int
	StartTime  time.Time
	EndTime    time.Time
	Cmd        *exec.Cmd        `json:"-"`
	ExitState  *os.ProcessState `json:"-"`
	InputFile  io.Reader        `json:"-"`
	OutputFile io.WriteCloser   `json:"-"`
	WaitCh     chan struct{}    `json:"-"`
}

func StartProcess

func StartProcess(label string, dir string, execPath string, args []string, inFile io.Reader, outFile io.WriteCloser) (*Process, error)

execPath: command name args: args to command. (should not include name)

func (*Process) StopProcess

func (proc *Process) StopProcess(kill bool) error

Jump to

Keyboard shortcuts

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