Documentation
¶
Overview ¶
Package timeout is for handling timeout invocation of external command
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExitStatus ¶
type ExitStatus struct {
Code int
// contains filtered or unexported fields
}
ExitStatus stores exit information of the command
func (ExitStatus) GetChildExitCode ¶
func (ex ExitStatus) GetChildExitCode() int
GetChildExitCode gets the exit code of the Cmd itself
func (ExitStatus) GetExitCode ¶
func (ex ExitStatus) GetExitCode() int
GetExitCode gets the exit code for command line tools
func (ExitStatus) IsKilled ¶
func (ex ExitStatus) IsKilled() bool
IsKilled returns the command is killed or not
func (ExitStatus) IsTimedOut ¶
func (ex ExitStatus) IsTimedOut() bool
IsTimedOut returns the command timed out or not
type Timeout ¶
type Timeout struct {
Duration time.Duration
KillAfter time.Duration
Signal os.Signal
Foreground bool
Cmd *exec.Cmd
}
Timeout is main struct of timeout package
func (*Timeout) Run ¶
func (tio *Timeout) Run() (ExitStatus, string, string, error)
Run is synchronous interface of executing command and returning information
func (*Timeout) RunCommand ¶
func (tio *Timeout) RunCommand() (chan ExitStatus, error)
RunCommand is executing the command and handling timeout. This is primitive interface of Timeout
Click to show internal directories.
Click to hide internal directories.

