remote

package
v0.37.4 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: MIT 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 struct {
	Host           string
	Port           string
	User           string
	PrivateKeyPath string
	ClientConfig   *ssh.ClientConfig
	Client         *ssh.Client
}

Connection is

func NewConnection

func NewConnection(host, port, user, keyPath string) (*Connection, error)

NewConnection will build and return a new Connection object

func (*Connection) CopyFromRemote added in v0.35.0

func (c *Connection) CopyFromRemote(hostname, path string) error

CopyFromRemote uses this ssh connection to get remote files via scp

func (*Connection) CopyToRemote added in v0.35.0

func (c *Connection) CopyToRemote(hostname, path string) error

CopyToRemote uses this ssh connection to send files via scp

func (*Connection) Execute

func (c *Connection) Execute(cmd string) ([]byte, error)

Execute will execute a given cmd on a remote host

func (*Connection) ExecuteWithRetries

func (c *Connection) ExecuteWithRetries(cmd string, sleep, duration time.Duration) ([]byte, error)

ExecuteWithRetries will keep retrying a command until it does not return an error or the duration is exceeded

func (*Connection) Read

func (c *Connection) Read(path string) ([]byte, error)

func (*Connection) Write

func (c *Connection) Write(data, path string) error

Jump to

Keyboard shortcuts

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