Documentation
¶
Index ¶
- type ProcManager
- func (pm *ProcManager) DeletePid(pid int)
- func (pm *ProcManager) Run(ctx context.Context, args []string, stdIn io.Reader, stdOut io.Writer, ...) error
- func (pm *ProcManager) RunWithRetries(ctx context.Context, args []string, stdIn io.Reader, stdOut io.Writer, ...) error
- func (pm *ProcManager) Stop() util.Errors
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.
Click to show internal directories.
Click to hide internal directories.