goscp

package
v0.0.0-...-e15fae0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2016 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	SSHClient       *ssh.Client
	DestinationPath []string

	// Verbose output when communicating with host
	Verbose bool

	// Stop transfer on OS error - occurs during filepath.Walk
	StopOnOSError bool

	// Show progress bar
	ShowProgressBar bool

	// Configurable progress bar
	ProgressBar *pb.ProgressBar
	// contains filtered or unexported fields
}

Client wraps a ssh.Client and provides additional functionality.

func NewClient

func NewClient(c *ssh.Client) *Client

NewClient returns a ssh.Client wrapper. DestinationPath is set to the current directory by default.

func (*Client) Cancel

func (c *Client) Cancel()

Cancel an ongoing operation.

func (*Client) Download

func (c *Client) Download(remotePath string)

Download remotePath to c.DestinationPath.

func (*Client) GetErrorStack

func (c *Client) GetErrorStack() []error

GetErrorStack returns all errors that have occurred so far.

func (*Client) GetLastError

func (c *Client) GetLastError() error

GetLastError should be queried after a call to Download() or Upload().

func (*Client) SetDestinationPath

func (c *Client) SetDestinationPath(path string)

SetDestinationPath sets where content will be sent.

func (*Client) Upload

func (c *Client) Upload(localPath string)

Upload localPath to c.DestinationPath.

Jump to

Keyboard shortcuts

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