Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection interface { Exec(cmd string) (stdout string, stderr string, exitCode int, err error) POpen(cmd string, stdin io.Reader, stdout io.Writer, stderr io.Writer) (exitCode int, err error) io.Closer }
Connection represents an established connection to an SSH server.
func NewConnection ¶
func NewConnection(connector *Connector, o Opts) (Connection, error)
NewConnection attempts to create a new SSH connection to the host specified via the given options.
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector holds a map of Connections
func (*Connector) Connect ¶
func (c *Connector) Connect(host kubeoneapi.HostConfig) (Connection, error)
Connect to the node
func (*Connector) Tunnel ¶ added in v1.0.0
func (c *Connector) Tunnel(host kubeoneapi.HostConfig) (Tunneler, error)
Tunnel returns established SSH tunnel
type Opts ¶
type Opts struct { Context context.Context Username string Password string Hostname string Port int PrivateKey string KeyFile string AgentSocket string Timeout time.Duration Bastion string BastionPort int BastionUser string }
Opts represents all the possible options for connecting to a remote server via SSH.
Click to show internal directories.
Click to hide internal directories.