Documentation
¶
Index ¶
- func DeleteFile(sc *sftp.Client, remoteFile string, removeDir bool) (err error)
- func DownloadFile(sc *sftp.Client, remoteFile, localFile string) (n int64, err error)
- func GetHostKey(host string) (ssh.PublicKey, error)
- func GetSSHconn(creds Credentials) (*ssh.Client, error)
- func ListDirsFiles(sc *sftp.Client, remoteDir string) (fsinfo []fs.FileInfo, err error)
- func UploadFile(sc *sftp.Client, localFile, remoteFile string) (n int64, err error)
- type Credentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteFile ¶
DeleteFile from SFTP server. A wrapper around sftp.Client.Remove and sftp.Client.RemoveDirectory. If removeDir is true but the directory is not empty, an error will be returned.
func DownloadFile ¶
DownloadFile from SFTP server
func GetHostKey ¶
GetHostKey from local known hosts
func GetSSHconn ¶
func GetSSHconn(creds Credentials) (*ssh.Client, error)
GetSSHconn tries to establish an SSH connection with given Credentials
func ListDirsFiles ¶
ListDirsFiles in a certain directory "remoteDir" on the SFTP server
Types ¶
Click to show internal directories.
Click to hide internal directories.