Documentation ¶
Overview ¶
Package executor executor heavily inspired from the Executor from github.com/rook/rook/pkg/util/exec pkg
Index ¶
- type CommandExecutor
- func (ce CommandExecutor) ExecuteCommand(ctx context.Context, actionName string, command string, arg ...string) error
- func (ce CommandExecutor) ExecuteCommandWithOutput(ctx context.Context, actionName string, command string, arg ...string) (string, error)
- func (ce CommandExecutor) ExecuteCommandWithOutputByte(ctx context.Context, actionName string, command string, arg ...string) ([]byte, error)
- type Executor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandExecutor ¶
type CommandExecutor struct { Executor // contains filtered or unexported fields }
CommandExecutor Executor implementation
func (CommandExecutor) ExecuteCommand ¶
func (ce CommandExecutor) ExecuteCommand(ctx context.Context, actionName string, command string, arg ...string) error
ExecuteCommand execute a given command with its arguments but don't return any output
func (CommandExecutor) ExecuteCommandWithOutput ¶
func (ce CommandExecutor) ExecuteCommandWithOutput(ctx context.Context, actionName string, command string, arg ...string) (string, error)
ExecuteCommandWithOutput execute a given command with its arguments and return the output as a string
func (CommandExecutor) ExecuteCommandWithOutputByte ¶
func (ce CommandExecutor) ExecuteCommandWithOutputByte(ctx context.Context, actionName string, command string, arg ...string) ([]byte, error)
ExecuteCommandWithOutputByte execute a given command with its arguments and return the output as a byte array ([]byte)
type Executor ¶
type Executor interface { ExecuteCommand(ctx context.Context, actionName string, command string, arg ...string) error ExecuteCommandWithOutput(ctx context.Context, actionName string, command string, arg ...string) (string, error) ExecuteCommandWithOutputByte(ctx context.Context, actionName string, command string, arg ...string) ([]byte, error) }
Executor heavily inspired from the Executor from github.com/rook/rook/pkg/util/exec pkg
func NewCommandExecutor ¶
NewCommandExecutor create and return a new CommandExecutor
Click to show internal directories.
Click to hide internal directories.