Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandExecution ¶
type CommandExecution struct { Command []string Cwd string Env map[string]string Sudo bool // contains filtered or unexported fields }
CommandExecution helps us build a command for running
func (*CommandExecution) Setenv ¶
func (c *CommandExecution) Setenv(k, v string) *CommandExecution
Setenv sets an environment variable for the command execution
func (*CommandExecution) WithCwd ¶
func (c *CommandExecution) WithCwd(cwd string) *CommandExecution
WithCwd sets the directory in which the command will execute
func (*CommandExecution) WithSudo ¶
func (c *CommandExecution) WithSudo() *CommandExecution
WithSudo indicates that the command should be executed with sudo
type Executor ¶
type LocalhostExecutor ¶
type LocalhostExecutor struct { }
func (*LocalhostExecutor) Close ¶
func (e *LocalhostExecutor) Close() error
func (*LocalhostExecutor) Mkdir ¶
func (s *LocalhostExecutor) Mkdir(dest string, mode os.FileMode) error
func (*LocalhostExecutor) Run ¶
func (s *LocalhostExecutor) Run(cmd *CommandExecution) error
type SSHExecutor ¶
type SSHExecutor struct {
// contains filtered or unexported fields
}
func (*SSHExecutor) Close ¶
func (e *SSHExecutor) Close() error
func (*SSHExecutor) Mkdir ¶
func (s *SSHExecutor) Mkdir(dest string, mode os.FileMode) error
SCPMkdir executes a mkdir against the SSH target, using SCP
func (*SSHExecutor) Run ¶
func (s *SSHExecutor) Run(cmd *CommandExecution) error
type Target ¶
type Target struct {
// contains filtered or unexported fields
}
SSH holds an SSH client, and adds utilities like SCP functionality
func (*Target) Command ¶
func (s *Target) Command(cmd ...string) *CommandExecution
Command builds a CommandExecution bound to the current SSH target
Click to show internal directories.
Click to hide internal directories.