ssh

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrompterEnvironmentVariable              = "MUTAGEN_SSH_PROMPTER"
	PrompterMessageBase64EnvironmentVariable = "MUTAGEN_SSH_PROMPTER_MESSAGE_BASE64"
)

Variables

This section is empty.

Functions

func Command

func Command(prompter, message string, remote *url.URL, command string) (*exec.Cmd, error)

Command create an SSH process set to connect to the specified remote and invoke the specified command. This function does not start the process. If a prompter and message are provided, the process will be directed to use them on startup if necessary. The command string is interpreted as literal input to the remote shell, so its contents are more flexible than just an executable name or path. The path component of the remote URL is NOT used as a working directory and is simply ignored - the command will execute in whatever default directory the server chooses.

func Copy

func Copy(prompter, message, local string, remote *url.URL) error

Copy copies a local file (which MUST be an absolute path) to a remote destination. If a prompter and message are provided, this method will attempt to use them for authentication if necessary.

func Output

func Output(prompter, message string, remote *url.URL, command string) ([]byte, error)

Output creates an SSH command by forwarding its arguments to Command and then returning the results of its Output method. If there is an error creating the command, it will be returned, but otherwise the result of the Run method will be returned un-wrapped, so it can be treated as an os/exec.ExitError.

func Run

func Run(prompter, message string, remote *url.URL, command string) error

Run creates an SSH command by forwarding its arguments to Command and then returning the result of its Run method. If there is an error creating the command, it will be returned, but otherwise the result of the Run method will be returned un-wrapped, so it can be treated as an os/exec.ExitError.

Types

This section is empty.

Jump to

Keyboard shortcuts

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