Versions in this module Expand all Collapse all v0 v0.9.0 Mar 19, 2016 Changes in this version + const KeyAuth + const PasswordAuth + const Timeout + var ErrInvalidAuth = errors.New("Invalid authorization method: missing password or key") + var ErrInvalidUsername = errors.New("A valid username must be supplied") + var ErrKeyGeneration = errors.New("Unable to generate key") + var ErrNotImplemented = errors.New("Operation not implemented") + var ErrPublicKey = errors.New("Unable to convert public key") + var ErrSSHInvalidMessageLength = errors.New("Invalid message length") + var ErrTimeout = errors.New("Timed out waiting for sshd to respond") + var ErrUnableToWriteFile = errors.New("Unable to write file") + var ErrValidation = errors.New("Unable to validate key") + type Client interface + Connect func() error + Disconnect func() + Download func(src io.WriteCloser, dst string) error + Run func(command string, stdout io.Writer, stderr io.Writer) error + SetSSHPassword func(string) + SetSSHPrivateKey func(string) + Upload func(src io.Reader, dst string, mode uint32) error + Validate func() error + WaitForSSH func(maxWait time.Duration) error + type Credentials struct + SSHPassword string + SSHPrivateKey string + SSHUser string + type KeyPair struct + PrivateKey []byte + PublicKey []byte + func NewKeyPair() (keyPair *KeyPair, err error) + func (kp *KeyPair) Fingerprint() string + func (kp *KeyPair) ReadFromFile(privateKeyPath string, publicKeyPath string) error + func (kp *KeyPair) WriteToFile(privateKeyPath string, publicKeyPath string) error + type MockSSHClient struct + MockConnect func() error + MockDisconnect func() + MockDownload func(src io.WriteCloser, dst string) error + MockRun func(command string, stdout io.Writer, stderr io.Writer) error + MockSetSSHPassword func(string) + MockSetSSHPrivateKey func(string) + MockUpload func(src io.Reader, dst string, mode uint32) error + MockValidate func() error + MockWaitForSSH func(maxWait time.Duration) error + func (c *MockSSHClient) Connect() error + func (c *MockSSHClient) Disconnect() + func (c *MockSSHClient) Download(src io.WriteCloser, dst string) error + func (c *MockSSHClient) Run(command string, stdout io.Writer, stderr io.Writer) error + func (c *MockSSHClient) SetSSHPassword(s string) + func (c *MockSSHClient) SetSSHPrivateKey(s string) + func (c *MockSSHClient) Upload(src io.Reader, dst string, mode uint32) error + func (c *MockSSHClient) Validate() error + func (c *MockSSHClient) WaitForSSH(maxWait time.Duration) error + type Options struct + IPs []net.IP + KeepAlive int + type SSHClient struct + Creds *Credentials + IP net.IP + Options Options + Port int + func (client *SSHClient) Connect() error + func (client *SSHClient) Disconnect() + func (client *SSHClient) Download(dst io.WriteCloser, remotePath string) error + func (client *SSHClient) Run(command string, stdout io.Writer, stderr io.Writer) error + func (client *SSHClient) SetSSHPassword(s string) + func (client *SSHClient) SetSSHPrivateKey(s string) + func (client *SSHClient) Upload(src io.Reader, dst string, mode uint32) error + func (client *SSHClient) Validate() error + func (client *SSHClient) WaitForSSH(maxWait time.Duration) error