This package provides an easy to use wrapper for the golang sftp package
Input:
host string,
username string,
privkeyfile string
Returns:
SFTPConnection
Input:
host string,
username string,
password string
Returns:
SFTPConnection
type SFTPConnection struct {
SftpClient *sftp.Client
IsVerbose bool
}
import ("sftphelper")
Connect With Key File: sftpConnection, err := sftphelper.ConnectWithKeyFile("test.sftpserver.com", "ec2-user", "/home/me/.ssh/sftpkeyfile.pem")
OR
Connect With Password: sftpConnection, err := sftphelper.ConnectWithKeyFile("test.sftpserver.com", "ec2-user", "password1")
sftpConnection.DownloadFiles("/home/ftptest/sourcePath/", "/home/me/")
Maria DeSouza maria.g.desouza@gmail.com