Documentation ¶
Index ¶
- func RunProcess(file string, args []string, env []string, stdin io.Reader) (stdout []byte, stderr []byte, code int, err error)
- func StartProcess(file string, args []string, env []string, started ProcessStartedFunc) error
- func StopProcess(pid int) error
- func WaitProcess(pid int, stopped ProcessStoppedFunc) error
- type ProcessStartedFunc
- type ProcessStoppedFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunProcess ¶
func RunProcess( file string, args []string, env []string, stdin io.Reader, ) (stdout []byte, stderr []byte, code int, err error)
RunProcess executes file, setting up environment using the provided env values. It waits for the process to finish and returns the stdout, stderr and return code.
func StartProcess ¶
func StartProcess( file string, args []string, env []string, started ProcessStartedFunc, ) error
StartProcess executes file, setting up the environment using the provided env values. If the function parameter started is not nil, it is invoked on a goroutine after the process has been started.
func StopProcess ¶
StopProcess finds a process with the given pid and kills it.
func WaitProcess ¶
func WaitProcess(pid int, stopped ProcessStoppedFunc) error
WaitProcess finds a process with the given pid and waits for it to exit. If the function parameter stopped is not nil, it is invoked on a goroutine when the process exits.
Types ¶
type ProcessStartedFunc ¶
type ProcessStartedFunc func(pid int, stdout, stderr io.ReadCloser)
type ProcessStoppedFunc ¶
type ProcessStoppedFunc func(pid int, state *os.ProcessState)
Click to show internal directories.
Click to hide internal directories.