Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCancelled = fmt.Errorf("cancelled")
ErrCancelled means command being cancelled
View Source
var ErrTimeout = fmt.Errorf("time out")
ErrTimeout means command timeout
View Source
var Log *logging.Logger
Log is *logging.Logger
View Source
var OutputChunkSize = 16384 // 16K
OutputChunkSize is buffer size of output string chunk sent to channel, default 16K.
View Source
var TmpOutputDataBuffer = 1048576 // 1M
TmpOutputDataBuffer is buffer size for output of a command before saving to tmpfile, default 1M.
View Source
var Verbose bool
Verbose decides whether print extra information
Functions ¶
Types ¶
type Command ¶
type Command struct {
ID uint64 // ID
Cmd string // command
Cancel chan struct{} // channel for close
Timeout time.Duration // time out
Ch chan string // channel for stdout
Err error // Error
Duration time.Duration // runtime
// contains filtered or unexported fields
}
Command is the Command struct
func NewCommand ¶
NewCommand create a Command
type Options ¶
type Options struct {
DryRun bool // just print command
Jobs int // max jobs number
KeepOrder bool // keep output order
Retries int // max retry chances
RetryInterval time.Duration // retry interval
Timeout time.Duration // timeout
StopOnErr bool // stop on any error
RecordSuccessfulCmd bool // send successful command to channel
Verbose bool
}
Options contains the options
Click to show internal directories.
Click to hide internal directories.