myssh

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cli

type Cli struct {
	IP         string       //IP地址
	Username   string       //用户名
	Password   string       //密码
	Port       int          //端口号
	SSH        *ssh.Client  //ssh客户端
	SFTP       *sftp.Client //sftp 客户端
	LastResult string       //最近一次Run的结果
	Log        easylogger.LoggerINF
}

func NewSSHClient

func NewSSHClient(ip string, username string, password string, port int, log easylogger.LoggerINF) *Cli

创建命令行对象 @param ip IP地址 @param username 用户名 @param password 密码 @param port 端口号,默认22

func (*Cli) GetDirFiles

func (c *Cli) GetDirFiles(path string) (ret []string, err error)

func (*Cli) Run

func (c *Cli) Run(shell string) (string, error)

执行shell @param shell shell脚本命令

func (*Cli) UpLoadPath added in v1.1.8

func (c *Cli) UpLoadPath(path string, data []byte) error

Jump to

Keyboard shortcuts

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