device

package
v0.0.0-...-cc66a5a Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Timeout = time.Duration(0)

Timeout is the duration to wait for an SSH connection to establish.

Functions

This section is empty.

Types

type Client

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

Client represents an SSH client for a network device.

func Dial

func Dial(host, port string, clientCfg *ssh.ClientConfig) (*Client, error)

Dial establishes an SSH client connection to a remote host.

func (*Client) Addr

func (c *Client) Addr() string

Addr returns the remote host's IP address.

func (*Client) Close

func (c *Client) Close() error

Close closes the SSH client connection to the remote host.

func (*Client) Hostname

func (c *Client) Hostname() string

Hostname returns the remote host's hostname.

func (*Client) Model

func (c *Client) Model() string

Model returns the remote host's model.

func (*Client) OS

func (c *Client) OS() string

OS returns the remote host's operating system.

func (*Client) Run

func (c *Client) Run(cmds ...string) ([]byte, error)

Run creates a new SSH session, starts a remote shell, and runs the specified commands on the remote host.

func (*Client) String

func (c *Client) String() string

String is the string representation of a client.

func (*Client) Vendor

func (c *Client) Vendor() string

Vendor returns the remote host's vendor.

func (*Client) Version

func (c *Client) Version() string

Version returns the remote host's software version.

Jump to

Keyboard shortcuts

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