sftp

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: MIT Imports: 4 Imported by: 0

README

Package sftp

This package provides a think layer on top of the pkg/sftp package. It includes a Client type that provides a higher level abstraction for sending and receiving files over SFTP. It also provides with a sftptest package that provides a mock SFTP server for testing purposes.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(network string, addr string, config *ssh.ClientConfig) (*Client, error)

func (*Client) Close

func (client *Client) Close() error

Close closes the connection to the remote server.

func (*Client) Download

func (client *Client) Download(path string, writer io.Writer) error

Download downloads the content of the source file on the remote server to the writer.

func (*Client) Upload

func (client *Client) Upload(local io.Reader, path string) error

Upload uploads the content of the reader to the target file on the remote server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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