executor

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package executor executor heavily inspired from the Executor from github.com/rook/rook/pkg/util/exec pkg

Index

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

func NewCommandExecutor(pkg string) Executor

NewCommandExecutor create and return a new CommandExecutor

Directories

Path Synopsis
Package test mock executor heavily inspired from the Executor from github.com/rook/rook/pkg/util/exec pkg#
Package test mock executor heavily inspired from the Executor from github.com/rook/rook/pkg/util/exec pkg#

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL