exec

package
v0.0.0-...-3f84afe Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: Apache-2.0 Imports: 9 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecuteInterface

type ExecuteInterface interface {
	Execute(envs []string, binary string, args []string, timeout time.Duration) (string, error)
	ExecuteWithStdin(binary string, args []string, stdinString string, timeout time.Duration) (string, error)
	ExecuteWithStdinPipe(binary string, args []string, stdinString string, timeout time.Duration) (string, error)
}

ExecuteInterface is the interface for executing commands.

func NewExecutor

func NewExecutor() ExecuteInterface

NewExecutor returns a new Executor.

type Executor

type Executor struct{}

Executor is the implementation of ExecuteInterface.

func (*Executor) Execute

func (e *Executor) Execute(envs []string, binary string, args []string, timeout time.Duration) (string, error)

Execute executes the given command with the specified environment variables, binary, and arguments. It returns the command's output and any occurred error.

func (*Executor) ExecuteWithStdin

func (e *Executor) ExecuteWithStdin(binary string, args []string, stdinString string, timeout time.Duration) (string, error)

ExecuteWithStdin executes the command with stdin.

func (*Executor) ExecuteWithStdinPipe

func (e *Executor) ExecuteWithStdinPipe(binary string, args []string, stdinString string, timeout time.Duration) (string, error)

ExecuteWithStdinPipe executes the command with stdin pipe.

Jump to

Keyboard shortcuts

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