Documentation ¶
Index ¶
- Variables
- type Client
- func (client *Client) Close() (err error)
- func (client *Client) Download(SRC, DEST string) (err error)
- func (client *Client) DownloadDirectory(SRC, DEST string) (err error)
- func (client *Client) DownloadFile(SRC, DEST string) (err error)
- func (client *Client) Run(command *Command) (err error)
- func (client *Client) Shell() (err error)
- func (client *Client) Upload(SRC, DEST string) (err error)
- func (client *Client) UploadDirectory(SRC, DEST string) (err error)
- func (client *Client) UploadFile(SRC, DEST string) (err error)
- type Command
- type Options
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client wraps SSH and SFTP clients.
func New ¶
New creates a new Client with provided Options. It establishes both SSH and SFTP clients.
func (*Client) Download ¶
Download transfers remote directories and files to local host. This works by calling DownloadDirectory or DownloadFile depending on the source.
func (*Client) DownloadDirectory ¶
DownloadDirectory transfers remote directories and contained files recursively to local host
func (*Client) DownloadFile ¶
DownloadFile transfers remote files to local host
func (*Client) Upload ¶
Upload transfers local directories and files to remote host. This works by calling UploadDirectory or UploadFile depending on the source.
func (*Client) UploadDirectory ¶
UploadDirectory transfers local directories and contained files recursively to remote host
func (*Client) UploadFile ¶
UploadFile transfers local files to remote host
type Command ¶
type Command struct { CMD string ENV map[string]string Stdin io.Reader Stdout io.Writer Stderr io.Writer }
Command represents remote commands structure.
type Options ¶
type Options struct { Host string Port int User string Authentication authentication.Authentication HostKeyCallback ssh.HostKeyCallback }
Options represents the options required to establish a SSH/SFTP connection.