Documentation
¶
Index ¶
- func SFtpClient(c *ssh.Client) (*sftp.Client, error)
- func SFtpDetectOS(sftpClient *sftp.Client) string
- func SFtpDownload(sftpClient *sftp.Client, l, r string) error
- func SFtpUpload(sftpClient *sftp.Client, l, r string) error
- func SshClient(user, password, host string, port int) (*ssh.Client, error)
- func SshSession(c *ssh.Client) (*ssh.Session, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SFtpClient ¶
SFtpClient 创建一个SFTP客户端连接。 参数:
- c: SSH客户端实例。
返回:
- *sftp.Client: SFTP客户端实例。
- error: 错误信息。
func SFtpDetectOS ¶
SFtpDetectOS 检测远程主机的操作系统类型。 参数:
- sftpClient: SFTP客户端实例。
返回:
- string: 操作系统类型("linux"、"mac"、"Windows" 或 "unknown")。
func SFtpDownload ¶
SFtpDownload 从远程主机下载文件到本地。 参数:
- sftpClient: SFTP客户端实例。
- l: 本地文件路径。
- r: 远程文件路径。
返回:
- error: 错误信息。
func SFtpUpload ¶
SFtpUpload 上传本地文件到远程主机。 参数:
- sftpClient: SFTP客户端实例。
- l: 本地文件路径。
- r: 远程文件路径。
返回:
- error: 错误信息。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.