Versions in this module Expand all Collapse all v0 v0.17.0 Aug 23, 2023 Changes in this version + var ErrKeyGeneration = errors.New("Unable to generate key") + var ErrPublicKey = errors.New("Unable to convert public key") + var ErrUnableToWriteFile = errors.New("Unable to write file") + var ErrValidation = errors.New("Unable to validate key") + func GenerateSSHKey(path string) error + func NewNativeConfig(user string, auth *Auth) (ssh.ClientConfig, error) + func SetDefaultClient(clientType ClientType) + type Auth struct + Keys []string + Passwords []string + type Client interface + Output func(command string) (string, error) + Shell func(args ...string) error + Start func(command string) (io.ReadCloser, io.ReadCloser, error) + Wait func() error + func NewClient(user string, host string, port int, auth *Auth) (Client, error) + func NewNativeClient(user, host string, port int, auth *Auth) (Client, error) + type ClientType string + const External + const Native + type ExternalClient struct + BaseArgs []string + BinaryPath string + func NewExternalClient(sshBinaryPath, user, host string, port int, auth *Auth) (*ExternalClient, error) + func (client *ExternalClient) Output(command string) (string, error) + func (client *ExternalClient) Shell(args ...string) error + func (client *ExternalClient) Start(command string) (io.ReadCloser, io.ReadCloser, error) + func (client *ExternalClient) Wait() error + type KeyPair struct + PrivateKey []byte + PublicKey []byte + func NewKeyPair() (keyPair *KeyPair, err error) + func (kp *KeyPair) Fingerprint() string + func (kp *KeyPair) WriteToFile(privateKeyPath string, publicKeyPath string) error + type NativeClient struct + Config ssh.ClientConfig + Hostname string + Port int + func (client *NativeClient) Output(command string) (string, error) + func (client *NativeClient) OutputWithPty(command string) (string, error) + func (client *NativeClient) Shell(args ...string) error + func (client *NativeClient) Start(command string) (io.ReadCloser, io.ReadCloser, error) + func (client *NativeClient) Wait() error