Documentation
¶
Index ¶
- type SSHSession
- func (thisSession *SSHSession) CloseSession()
- func (thisSession *SSHSession) DownloadFile(remoteFilePath string, localFilePath string)
- func (thisSession *SSHSession) ExecuteShellCommand(command string, moreCommand string, prompt string, clearLine string) (string, error)
- func (thisSession *SSHSession) ExecuteSingleCommand(command string) (string, error)
- func (thisSesion *SSHSession) GetShellCommandResult(prompt string, moreCommand string, clearLine string) string
- func (thisSesion *SSHSession) SendShellCommand(command string) error
- func (thisSession *SSHSession) UploadFile(localFilePath string, remoteFilePath string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SSHSession ¶ added in v1.8.2
type SSHSession struct {
// contains filtered or unexported fields
}
func NewSSHSession ¶
func NewSSHSession(hostNameAndPort string, userName string, password string, timeout int) *SSHSession
func (*SSHSession) CloseSession ¶ added in v1.8.2
func (thisSession *SSHSession) CloseSession()
func (*SSHSession) DownloadFile ¶ added in v1.8.2
func (thisSession *SSHSession) DownloadFile(remoteFilePath string, localFilePath string)
func (*SSHSession) ExecuteShellCommand ¶ added in v1.8.2
func (thisSession *SSHSession) ExecuteShellCommand(command string, moreCommand string, prompt string, clearLine string) (string, error)
ExecuteCommand 执行命令,当需要 huawei' clear line command is "\x1B[42D"
func (*SSHSession) ExecuteSingleCommand ¶ added in v1.8.2
func (thisSession *SSHSession) ExecuteSingleCommand(command string) (string, error)
func (*SSHSession) GetShellCommandResult ¶ added in v1.8.2
func (thisSesion *SSHSession) GetShellCommandResult(prompt string, moreCommand string, clearLine string) string
func (*SSHSession) SendShellCommand ¶ added in v1.8.2
func (thisSesion *SSHSession) SendShellCommand(command string) error
func (*SSHSession) UploadFile ¶ added in v1.8.2
func (thisSession *SSHSession) UploadFile(localFilePath string, remoteFilePath string)
Click to show internal directories.
Click to hide internal directories.