commandexecutor

package
v0.0.0-...-9b7a7ab Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandExecutorInterface

type CommandExecutorInterface interface {
	Run(addr string, command string, stdin io.Reader, routeToStd bool) (bytes.Buffer, bytes.Buffer, error)
}

This interface allows to execute a command either locally or on a remote server.

type ServodCommandExecutor

type ServodCommandExecutor struct {
	// contains filtered or unexported fields
}

ServodCommandExecutor acts as a receiver to implement CommandExecutorInterface by running given commands either locally or on a remote host through os/exec and SSH run commands.

func NewServodCommandExecutor

func NewServodCommandExecutor(logger *log.Logger) ServodCommandExecutor

func (ServodCommandExecutor) Run

func (s ServodCommandExecutor) Run(addr string, command string, stdin io.Reader, routeToStd bool) (bytes.Buffer, bytes.Buffer, error)

Run executes a given command either on a remote host specified by addr or locally when addr is empty or "localhost".

Jump to

Keyboard shortcuts

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