Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor interface {
// Execute runs a command and returns its standard output
Execute(name string, args ...string) ([]byte, error)
// ExecuteWithStdio runs a command with connected standard I/O
ExecuteWithStdio(name string, args ...string) error
// LookPath checks if a command exists
LookPath(name string) (string, error)
}
Executor abstracts shell command execution
type MockExecutor ¶
type MockExecutor struct {
ExecuteFunc func(name string, args ...string) ([]byte, error)
ExecuteWithStdioFunc func(name string, args ...string) error
LookPathFunc func(name string) (string, error)
}
MockExecutor for testing
func (*MockExecutor) Execute ¶
func (m *MockExecutor) Execute(name string, args ...string) ([]byte, error)
func (*MockExecutor) ExecuteWithStdio ¶
func (m *MockExecutor) ExecuteWithStdio(name string, args ...string) error
type RealExecutor ¶
type RealExecutor struct{}
RealExecutor implements actual command execution
func NewRealExecutor ¶
func NewRealExecutor() *RealExecutor
NewRealExecutor creates a new RealExecutor
func (*RealExecutor) Execute ¶
func (e *RealExecutor) Execute(name string, args ...string) ([]byte, error)
Execute runs a command and returns its output
func (*RealExecutor) ExecuteWithStdio ¶
func (e *RealExecutor) ExecuteWithStdio(name string, args ...string) error
ExecuteWithStdio runs a command with connected standard I/O
Click to show internal directories.
Click to hide internal directories.