Skip to content
  • Miquel Sabaté Solà's avatar
    libmachine/ssh: added the Start and Wait functions to the Client interface · 0a2b5ab4
    Miquel Sabaté Solà authored
    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.
    
    Signe...
    0a2b5ab4