Documentation ¶
Index ¶
Constants ¶
View Source
const ( // OKExitStatus specifies the command execution exit status // that indicates a success, A-OK. OKExitStatus int = 0 // FallbackExitStatus specifies the command execution exit // status used when golang is unable to determine the exit // status. FallbackExitStatus int = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Execution ¶
type Execution struct {
// contains filtered or unexported fields
}
func NewExecution ¶
func NewExecution(ctx context.Context, request ExecutionRequest) *Execution
NewExecution based on an ExecutionRequest
func (*Execution) Run ¶
func (c *Execution) Run() (resp ExecutionResponse, err error)
Run the command. May only be invoked once.
type ExecutionRequest ¶
type ExecutionRequest struct { // Command is the command to be executed. This is the only field that must // be set non-zero. Behaves like os/exec.Cmd's Path field. Command string // Arguments to execute the command with. Arguments []string // Env variables to include Env []string // Timeout when set non-zero functions as a timer for starting and running // a command on Execution.Run Timeout time.Duration }
ExecutionRequest describes an external command to be executed.
type ExecutionResponse ¶
type ExecutionResponse struct { // Command execution exit status. Status int // Duration provides command execution time. Duration time.Duration // Error is passed when the outcome of the execution is uncertain Error error }
ExecutionResponse provides the response information of an ExecutionRequest.
Click to show internal directories.
Click to hide internal directories.