procmanager

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: MIT Imports: 8 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProcManager

type ProcManager struct {
	DryRun bool
	// contains filtered or unexported fields
}

ProcManager is a wrapper for os.Process.

func NewProcManager

func NewProcManager(dryRun bool) *ProcManager

NewProcManager creates a new ProcManager.

func (*ProcManager) DeletePid

func (pm *ProcManager) DeletePid(pid int)

DeletePid deletes the specified pid from the internal map.

func (*ProcManager) Run

func (pm *ProcManager) Run(
	ctx context.Context,
	args []string,
	stdIn io.Reader,
	stdOut io.Writer,
	stdErr io.Writer,
	cmdDir string) error

Run runs an exec.Command based on the specified args. stdIn, stdOut, stdErr, and cmdDir can be attached to the created exec.Command.

func (*ProcManager) RunWithRetries added in v1.0.10

func (pm *ProcManager) RunWithRetries(
	ctx context.Context,
	args []string,
	stdIn io.Reader,
	stdOut io.Writer,
	stdErr io.Writer,
	cmdDir string,
	retries int,
	retryDelay int) error

RunWithRetries performs Run with retries.

func (*ProcManager) Stop

func (pm *ProcManager) Stop() util.Errors

Stop stops the process manager and tries to kill any remaining processes in its internal map. Any errors encountered during kill will be return as a list of errors.

Jump to

Keyboard shortcuts

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