Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecuteOptionFunc ¶
type ExecuteOptionFunc func(*ExecutorTimeMeasurement)
ExecuteOptionFunc is a function to set executor options
func WithShowDuration ¶
func WithShowDuration() ExecuteOptionFunc
WithShowDuration enables to show command duration
func WithWrite ¶
func WithWrite(w io.Writer) ExecuteOptionFunc
WithWrite set the writer to be used by DefaultExecutor
type ExecutorTimeMeasurement ¶
type ExecutorTimeMeasurement struct {
// contains filtered or unexported fields
}
ExecutorTimeMeasurement is a middleware that measure the execution time of a command
func NewExecutorTimeMeasurement ¶
func NewExecutorTimeMeasurement(executor execute.Executor, options ...ExecuteOptionFunc) *ExecutorTimeMeasurement
NewExecutorTimeMeasurement returns a new ExecutorTimeMeasurement
func (*ExecutorTimeMeasurement) Duration ¶
func (e *ExecutorTimeMeasurement) Duration() time.Duration
Duration returns the duration of the command
func (*ExecutorTimeMeasurement) Execute ¶
func (e *ExecutorTimeMeasurement) Execute(ctx context.Context, command []string, resultsFunc stdoutcallback.StdoutCallbackResultsFunc, options ...execute.ExecuteOptions) error
Execute takes a command and args and runs it, streaming output to stdout
Click to show internal directories.
Click to hide internal directories.