Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GenerateSSHKey ¶
Generate SSH keypair based on path of the private key The public key would be generated to the same path with ".pub" added
func NewNativeConfig ¶
func NewNativeConfig(user string, auth *Auth) (ssh.ClientConfig, error)
func SetDefaultClient ¶
func SetDefaultClient(clientType SSHClientType)
Types ¶
type ExternalClient ¶
func NewExternalClient ¶
func NewExternalClient(sshBinaryPath, user, host string, port int, auth *Auth) (ExternalClient, error)
func (ExternalClient) Shell ¶
func (client ExternalClient) Shell(args ...string) error
type KeyPair ¶
func NewKeyPair ¶
Generate a new SSH keypair This will return a private & public key encoded as DER.
func (*KeyPair) Fingerprint ¶
Calculate the fingerprint of the public key
type NativeClient ¶
type NativeClient struct { Config ssh.ClientConfig Hostname string Port int }
func (NativeClient) OutputWithPty ¶
func (client NativeClient) OutputWithPty(command string) (string, error)
func (NativeClient) Shell ¶
func (client NativeClient) Shell(args ...string) error
type SSHClientType ¶
type SSHClientType string
const ( External SSHClientType = "external" Native SSHClientType = "native" )
Click to show internal directories.
Click to hide internal directories.