remote

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 NewConnectionWithRetry added in v0.42.0

func NewConnectionWithRetry(host, port, user, keyPath string, sleep, timeout time.Duration) (*Connection, error)

NewConnectionWithRetry establishes an ssh connection, allowing for retries

func (*Connection) CopyFrom added in v0.41.0

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

CopyFrom uses this ssh connection to get remote files via scp

func (*Connection) CopyTo added in v0.41.0

func (c *Connection) CopyTo(filename string) error

CopyTo uses this ssh connection to send files to the remote ssh listener's underlying file system

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 to a remote host

func (*Connection) Execute

func (c *Connection) Execute(cmd string, printStdout bool) error

Execute will execute a given cmd on a remote host

func (*Connection) ExecuteRemote added in v0.41.0

func (c *Connection) ExecuteRemote(node, command string, printStdout bool) error

ExecuteRemote uses this ssh connection to run a remote command from the primary master node

func (*Connection) ExecuteRemoteWithRetry added in v0.42.0

func (c *Connection) ExecuteRemoteWithRetry(node, command string, printStdout bool, sleep, timeout time.Duration) error

ExecuteRemoteWithRetry runs a remote command with retry tolerance

func (*Connection) Read

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

func (*Connection) Write

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

type NewConnectionResult added in v0.42.0

type NewConnectionResult struct {
	Connection *Connection
	Err        error
}

NewConnectionResult is the result type for GetConfigAsync

func NewConnectionAsync added in v0.42.0

func NewConnectionAsync(host, port, user, keyPath string) NewConnectionResult

NewConnectionAsync wraps NewConnection with a struct response for goroutine + channel usage

Jump to

Keyboard shortcuts

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