package module
Version: v0.0.0-...-19dd408 Latest Latest

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

Go to latest
Published: Jun 19, 2016 License: MPL-2.0 Imports: 8 Imported by: 1



An easy to use sftp library that has convenvience methods for SFTP and SSH.





This section is empty.


This section is empty.


This section is empty.


type Client

type Client struct {
	// contains filtered or unexported fields

Client communicates with the SFTP to download files/pathes

func Connect

func Connect(config *ClientConfig) (*Client, error)

Connect to a host with this given config

func (*Client) Close

func (c *Client) Close() error

Close the underlying SSH conection

func (*Client) Download

func (c *Client) Download(path string, output io.Writer, offset int64) error

Download a file from the given path to the output writer with the given offset of the remote file

func (*Client) Lstat

func (c *Client) Lstat(path string) (os.FileInfo, error)

Lstat gets information for the given path, if it is a symbolic link, it will describe the symbolic link

func (*Client) Mirror

func (c *Client) Mirror(path string, localParentPath string, resume bool) error

Mirror downloads an entire folder (recursively) or file underneath the given localParentPath resume will try to continue downloading interrupted files

func (*Client) Stat

func (c *Client) Stat(path string) (os.FileInfo, error)

Stat gets information for the given path

type ClientConfig

type ClientConfig struct {
	Username string
	Host     string
	KeyPath  string
	Password string
	Timeout  time.Duration
	FileMode os.FileMode

ClientConfig maintains all of the configuration info to connect to a SSH host

Source Files

Jump to

Keyboard shortcuts

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