Documentation
¶
Overview ¶
Package ssh provides the connection helper for ssh:// URL.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Spec ¶
Spec of SSH URL
func NewSpec ¶
NewSpec creates a Spec from the given ssh URL's properties. It returns an error if the URL is using the wrong scheme, contains fragments, query-parameters, or contains a password.
func ParseURL ¶
ParseURL creates a Spec from the given ssh URL. It returns an error if the URL is using the wrong scheme, contains fragments, query-parameters, or contains a password.
func (*Spec) Args ¶
Args returns args except "ssh" itself combined with optional additional command and args to be executed on the remote host. It attempts to quote the given arguments to account for ssh executing the remote command in a shell. It returns nil when unable to quote the remote command.
func (*Spec) Command ¶
Command returns the ssh flags and arguments to execute a command (remoteCommandAndArgs) on the remote host. Where needed, it quotes values passed in remoteCommandAndArgs to account for ssh executing the remote command in a shell. It returns an error if no remote command is passed, or when unable to quote the remote command.
Important: to preserve backward-compatibility, Command does not currently perform sanitization or quoting on the sshFlags and callers are expected to sanitize this argument.