Documentation
¶
Index ¶
- type Cli
- func (c *Cli) Close()
- func (c *Cli) CombineRemoteFile(fileList []string, target string)
- func (c *Cli) ConcatRemoteFile(fileList []string, target string)
- func (c *Cli) Connect() (*Cli, error)
- func (c *Cli) CreateFile(remoteFileName string) (*sftp.File, error)
- func (c *Cli) IsFileExist(path string) bool
- func (c Cli) Run(shell string) (string, error)
- func (c Cli) RunQuiet(shell string) error
- func (c *Cli) SliceUpload(target string, filePath string, num int) []string
- func (c *Cli) UploadDir(base string, target string)
- func (c *Cli) UploadFile(localFile, remoteFileName string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cli ¶
type Cli struct {
Host string // 主机地址
User string // 登录用户
Password string // 密码
Client *ssh.Client // bash操作
SftpClient *sftp.Client // 文件操作
LastResult string // 执行的最后一次结果
PrivateKey []byte // 私钥串
PublicKey []byte // 远程服务器的公钥串,如果有传则校验,可以不传
}
连接信息
func (*Cli) ConcatRemoteFile ¶ added in v1.10.0
合并远程文件
Click to show internal directories.
Click to hide internal directories.