Documentation ¶
Overview ¶
Package execer provides an easy way to start system command in the background and monitor them.
Example ¶
// Create the execer cmd := []string{"echo", "Hello World!"} execer, err := Init(cmd) if err != nil { fmt.Println(err) return } // Start the command in the background err = execer.Start() if err != nil { fmt.Println(err) return } // Get status of the command status := execer.Status() if status.Error != nil { fmt.Println(status.Error) return } fmt.Println(status.Stdout)
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Execer ¶
type Execer struct {
// contains filtered or unexported fields
}
Execer represent the Command to run.
type Status ¶
Status represent the (temporarily) status of a Execer.
Error stores the (last) error. Finished indicates if the command still running. Started indicates if the command is already started. Stdout contains the commands stdout until the time the Status was created. Stderr contains the commands stderr until the time the Status was created.
Click to show internal directories.
Click to hide internal directories.