ssh

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package ssh provides SSH facilities on top of OpenSSH. It may additionally extend to support other SSH implementations.

Index

Constants

View Source
const (
	// PrompterEnvironmentVariable is the environment variable in which the
	// Mutagen prompter identifier is stored.
	PrompterEnvironmentVariable = "MUTAGEN_SSH_PROMPTER"
)

Variables

This section is empty.

Functions

func Command

func Command(prompter 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 is provided, the process will be directed to use it 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, local string, remote *url.URL) error

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

func Output

func Output(prompter 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 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