Documentation ¶
Index ¶
- Variables
- func Clean(s string) string
- func Command(timeout time.Duration, name string, arg ...string) ([]byte, error)
- func ReadCommand(line func(string) error, name string, arg ...string) error
- func ReadCommandTimeout(timeout time.Duration, line func(string) error, name string, arg ...string) error
- func Set()
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPath = errors.New("program not in PATH") ErrTimeout = errors.New("program killed after timeout") )
View Source
var ( Hostname string // FullHostname, if false, uses the hostname upto the first ".". Run Set() // manually after changing. FullHostname bool )
Functions ¶
func Command ¶
Command executes the named program with the given arguments. If it does not exit within timeout, it is sent SIGINT (if supported by Go). After another timeout, it is killed.
func ReadCommand ¶
ReadCommand runs command name with args and calls line for each line from its stdout. Command is interrupted (if supported by Go) after 10 seconds and killed after 20 seconds.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.