Documentation ¶
Overview ¶
Package proc is process utilities
Index ¶
- Variables
- func Command(cmd string, args ...string) *exec.Cmd
- func GroupKill(pid int, signal os.Signal) error
- func KillWithChildren(p *os.Process, interrupt bool) (err error)
- func Pkill(pid int, signal os.Signal) error
- func RunWithTimeout(timeoutSeconds int, cmd *exec.Cmd) error
- func WithTimeout(timeoutSeconds int, todo func() error, onTimeout func() error) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTimedOut = errors.New("child timed out")
ErrTimedOut is an error for child timeout
View Source
var IntTimeout = 3 * time.Second
IntTimeout is the duration to wait before Kill after Int
View Source
var Log = func(keyvals ...interface{}) error { return nil }
Log is discarded by default
Functions ¶
func Command ¶
Command returns an *exec.Cmd for calling the given cmd with args in cmd /c, with all the needed escapes - see https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/
func KillWithChildren ¶
KillWithChildren kills the process and tries to kill its all children (process group)
func RunWithTimeout ¶
RunWithTimeout runs cmd, and kills the child on timeout
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.