Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { Host string `json:"host"` // 服务器IP或者域名 Port int `json:"port"` // 服务器端口 UserName string `json:"username"` // 用户名 Password string `json:"password"` // 如果使用id_rsa登录,即为私钥密码,反之则是登录用户密码 IdRsaPath string `json:"IdRsaPath"` // id_rsa 路径 如:./id_rsa Session *ssh.Session // 服务器session }
func (*Server) ExecCmd ¶
*
- 服务器执行命令
- BaZhang Platform
- @Author Jacklin@shouyiren.net
- @DateTime 2021-11-06T10:48:22+0800
- @param {[type]} server *Server) ExecCmd(cmd string) ([]byte, error [description]
- @return {[type]} [执行结果,错误信息]
func (*Server) GetSession ¶
*
- 获取服务器Session
- BaZhang Platform
- @Author Jacklin@shouyiren.net
- @DateTime 2021-11-05T16:07:06+0800
- @param {[type]} server *Server) GetSession(cipherList []string) (*ssh.Session, error [过程中错误]
- @return {[type]} [返回服务器Session]
Click to show internal directories.
Click to hide internal directories.