docs/libmachine/examples
Miquel Sabaté Solà 0a2b5ab4d3 libmachine/ssh: added the Start and Wait functions to the Client interface
The Start function starts an SSH session and executes the given command. The
returned parameters are readers for the stdout and stderr. This way, developers
can further manipulate the output of the remote command. The Wait function is
command to that of the exec.Cmd type.

The readers returned by the Start function are io.ReadCloser instead of
io.Reader, as one might think. This is done this way to simplify the API so
the ExternalClient doesn't have to provide extra functions to close the
io.ReadCloser's as returned by the cmd.StdoutPipe and cmd.StderrPipe functions.

Finally, I've also changed the receivers of the functions related to the Native
and the External clients. This is done this way because we need to save the
open session or the command from each client in order to implement the Wait
function. Note that the Wait function is needed in order to properly close the
session that is hidden underneath the Native client.

Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
2016-01-27 09:52:29 +01:00
..
main.go libmachine/ssh: added the Start and Wait functions to the Client interface 2016-01-27 09:52:29 +01:00