ssh

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

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)
	File(filename string, flags int) (io.ReadWriteCloser, error)
	Stream(cmd string, 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(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 NewConnector

func NewConnector() *Connector

NewConnector constructor

func (*Connector) CloseAll

func (c *Connector) CloseAll()

CloseAll closes all connections

func (*Connector) Connect

func (c *Connector) Connect(node kubeoneapi.HostConfig) (Connection, error)

Connect to the node

type Opts

type Opts struct {
	Username    string
	Password    string
	Hostname    string
	Port        int
	PrivateKey  string
	KeyFile     string
	AgentSocket string
	Timeout     time.Duration
}

Opts represents all the possible options for connecting to a remote server via SSH.

Jump to

Keyboard shortcuts

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