Documentation ¶
Overview ¶
Package commands provides a wrapper around os/exec to consistently manage process execution, cancellation of their child processes, timeouts, logging, arg parsing, and correct shutdown.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
type Command struct { Name string // this gets used only in logs, defaults to Exec Cmd *exec.Cmd Exec string Args []string Timeout time.Duration // contains filtered or unexported fields }
Command wraps an os/exec.Cmd with a timeout, logging, and arg parsing.
func NewCommand ¶
NewCommand parses JSON config into a Command
func (*Command) Kill ¶
func (c *Command) Kill()
Kill sends a kill signal to the underlying process if it still exists, as well as all its children
Click to show internal directories.
Click to hide internal directories.