ssh

package
v0.8.2-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a higher-level abstraction around the standard API's SSH configuration, client and connection to the remote machine.

func NewClient

func NewClient(params ClientParams) (*Client, error)

NewClient instantiates a new SSH Client object. N.B.: provide either the key (privateKey) or its path (privateKeyPath).

func NewClientForMachine

func NewClientForMachine(m *v1alpha1.BareMetalMachineProviderSpec, user, keyPath string, printOutputs bool) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

Close closes this high-level Client's underlying SSH connection.

func (*Client) RemoteAddr

func (c *Client) RemoteAddr() net.Addr

RemoteAddr returns the remote address of this SSH client.

func (*Client) RunCommand

func (c *Client) RunCommand(command string, stdin io.Reader) (string, error)

RunCommand executes the provided command on the remote machine configured in this Client object. A new Session is created for each call to RunCommand. A Client supports multiple interactive sessions.

type ClientParams

type ClientParams struct {
	User           string
	Host           string
	Port           uint16
	PrivateKeyPath string
	PrivateKey     []byte
	PrintOutputs   bool
}

ClientParams groups inputs to build a client object.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL