Documentation ¶
Index ¶
- Constants
- Variables
- func Add(desc string, cmd *exec.Cmd) int64
- func Exec(desc, cmdName string, args ...string) (string, string, error)
- func ExecDir(timeout time.Duration, dir, desc, cmdName string, args ...string) (string, string, error)
- func ExecTimeout(timeout time.Duration, desc, cmdName string, args ...string) (string, string, error)
- func Kill(pid int64) error
- func Remove(pid int64) bool
- type Process
Constants ¶
View Source
const DEFAULT_TIMEOUT = 60 * time.Second
Variables ¶
View Source
var (
ErrExecTimeout = errors.New("process execution timeout")
)
View Source
var Processes []*Process
Functions ¶
func Exec ¶
Exec starts executing a shell command, it tracks corresponding its process and use default timeout.
func ExecDir ¶
func ExecDir(timeout time.Duration, dir, desc, cmdName string, args ...string) (string, string, error)
Exec starts executing a shell command in given path, it tracks corresponding process and timeout.
Types ¶
Click to show internal directories.
Click to hide internal directories.