Documentation
¶
Index ¶
- type FolderMapping
- type Response
- type SFTPClient
- func (c *SFTPClient) BackupFiles(destination string, files []string, response chan<- Response)
- func (c *SFTPClient) Close() error
- func (c *SFTPClient) CreateDir(remoteFolderPath string) error
- func (c *SFTPClient) CreateDirHierarchy(remoteFolderPath string) error
- func (c *SFTPClient) FindAllRemoteFiles(paths []string) ([]string, error)
- func (c *SFTPClient) FindRemoteFiles(path string) func() (r <-chan Response)
- func (c *SFTPClient) GetFile(localFilename string, remoteFilename string) error
- func (c *SFTPClient) GetFiles(folders []FolderMapping, response chan<- Response, count chan<- int, ...)
- func (c *SFTPClient) PutFile(remoteFileName string, localFileName string) error
- func (c *SFTPClient) PutFiles(folders []FolderMapping, response chan<- Response, count chan<- int, ...)
- func (c *SFTPClient) TarFile(w *tar.Writer, filename string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FolderMapping ¶
FolderMapping maps local to remote folders
type SFTPClient ¶
type SFTPClient struct {
// contains filtered or unexported fields
}
SFTPClient is a proxy to sftp.Client
func New ¶
func New(hostname string, port int, username string, password string) (client *SFTPClient, err error)
New SFTP Connection
func (*SFTPClient) BackupFiles ¶
func (c *SFTPClient) BackupFiles(destination string, files []string, response chan<- Response)
BackupFiles saves remote files to a local tar.gz file
func (*SFTPClient) CreateDir ¶
func (c *SFTPClient) CreateDir(remoteFolderPath string) error
CreateDir creates a folder on remote location
func (*SFTPClient) CreateDirHierarchy ¶
func (c *SFTPClient) CreateDirHierarchy(remoteFolderPath string) error
CreateDirHierarchy creates a folder hierarchy on remote location
func (*SFTPClient) FindAllRemoteFiles ¶
func (c *SFTPClient) FindAllRemoteFiles(paths []string) ([]string, error)
FindAllRemoteFiles enumerates all remote files in multiple directories and their descendents
func (*SFTPClient) FindRemoteFiles ¶
func (c *SFTPClient) FindRemoteFiles(path string) func() (r <-chan Response)
FindRemoteFiles enumerates files in a remote directory
func (*SFTPClient) GetFile ¶
func (c *SFTPClient) GetFile(localFilename string, remoteFilename string) error
GetFile retreives a file from remote location
func (*SFTPClient) GetFiles ¶
func (c *SFTPClient) GetFiles(folders []FolderMapping, response chan<- Response, count chan<- int, done chan<- bool)
GetFiles retreives all files from a remote location
func (*SFTPClient) PutFile ¶
func (c *SFTPClient) PutFile(remoteFileName string, localFileName string) error
PutFile uploads a local file to remote location
func (*SFTPClient) PutFiles ¶
func (c *SFTPClient) PutFiles(folders []FolderMapping, response chan<- Response, count chan<- int, done chan<- bool)
PutFiles uploads all local files to remote location
Click to show internal directories.
Click to hide internal directories.