sftp

package
v0.0.0-...-2be5f8e Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectSFTP

func ConnectSFTP(host, username, password, privateKey string, port int, publicKeyAuth, ignoreHostKey bool) (*sftp.Client, error)

connectSFTP creates ssh config, tries to connect (dial) SSH server and creates new client with connection

func Mput

func Mput(client *sftp.Client, srcFile, dstFile string, isEcho bool) error

puts a local file or files in the srcFile to remote server *sftp.Client a sftp connection opened by connectSFTP, srcFile resource file or resource directory,dstFile destination file or directory. put will create a subdirectory named with the file name of srcFile in dstFile if srcFile is a directory. return error if error occured,otherwise return nil.

func Put

func Put(client *sftp.Client, srcFile, dstFile string) error

puts a local file to remote server *sftp.Client a sftp connection opened by connectSFTP, srcFile resource file, dstFile destination file. return error if error occured,otherwise return nil. Note: srcFile must be the path of a regular file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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