gokit

package
v0.0.0-...-15846b5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecCommand

func ExecCommand(c string) (string, error)

执行本地命令行 cmd 执行的命令行

Types

type FTP

type FTP struct {
	Host     string // 地址
	Username string // 用户名
	Password string // 密码
	Port     int    // 端口号
}

func (*FTP) FileDelete

func (f *FTP) FileDelete(filePathName string) error

FTP 删除文件 filePathName 删除文件

func (*FTP) FileDownload

func (f *FTP) FileDownload(filePath, remotePathName string) error

FTP 下载文件 filePath 本地目录 remotePath 远程文件路径名

func (*FTP) FileUpload

func (f *FTP) FileUpload(filePathName string, content []byte) error

FTP 上传文件 filePathName 文件路径名 content 文件内容

func (*FTP) FtpClient

func (f *FTP) FtpClient() (*ftp.ServerConn, error)

type SFTP

type SFTP struct {
	Host     string // 地址
	Username string // 用户名
	Password string // 密码
	Port     int    // 端口号
}

func (*SFTP) FileDelete

func (s *SFTP) FileDelete(filePathName string) error

FTP 删除文件 filePathName 删除文件

func (*SFTP) FileDownload

func (s *SFTP) FileDownload(filePath, remotePathName string) error

SFTP 下载文件 filePath 本地目录 remotePath 远程文件路径名

func (*SFTP) FileUpload

func (s *SFTP) FileUpload(filePathName string, content []byte) error

SFTP 上传文件 filePathName 文件路径名 content 文件内容

func (*SFTP) SftpClient

func (s *SFTP) SftpClient() (*sftp.Client, error)

type SSH

type SSH struct {
	Host     string // 地址
	Username string // 用户名
	Password string // 密码
	Port     int    // 端口号
}

func (*SSH) ExecSSH

func (s *SSH) ExecSSH(c string) ([]byte, error)

执行远程SSH命令行 cmd 执行的命令行

func (*SSH) SSHClient

func (s *SSH) SSHClient() (*ssh.Session, error)

Jump to

Keyboard shortcuts

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