Documentation ¶
Index ¶
- func Retry(times int, interval time.Duration, f func() error) error
- func Run(timeout time.Duration, bin string, args ...string) (int, string, string, error)
- func RunWithRetry(times int, interval, timeout time.Duration, bin string, args ...string) (int, string, string, error)
- type Process
- type Processes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Retry ¶
Retry will run function with times, if err is nil, it will return nil, if over times, it will return last error.
func Run ¶
Run returns running command result with timeout, returns are command exit code, stdout iostream, stderr iostream, error.
func RunWithRetry ¶
func RunWithRetry(times int, interval, timeout time.Duration, bin string, args ...string) (int, string, string, error)
RunWithRetry returns running command with "times" retries, must keep exit is 0 when execute success, returns are command exit code, stdout iostream, stderr iostream, error.
Types ¶
type Process ¶
type Process struct { // Binary's absolute path. Path string // Arguments use to execute binary. Args []string // Output represents a file that the stdio and stderr will write. Output string sync.Mutex // contains filtered or unexported fields }
Process represents a program will be execute.
Click to show internal directories.
Click to hide internal directories.