Documentation
¶
Overview ¶
sshclient ssh client library
Index ¶
- type SSHConnection
- type SSHSession
- func (thisSession *SSHSession) BindInputOutput() error
- 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 (thisSession *SSHSession) GetShellCommandResult(prompt string, moreCommand string, clearLine string) string
- func (thisSession *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 SSHConnection ¶ added in v1.8.2
type SSHConnection struct {
// contains filtered or unexported fields
}
func NewSSHConnection ¶ added in v1.8.2
func NewSSHConnection(hostNameAndPort string, userName string, password string, timeout int) *SSHConnection
func (*SSHConnection) CloseConnection ¶ added in v1.8.2
func (thisConnection *SSHConnection) CloseConnection()
func (*SSHConnection) NewSession ¶ added in v1.8.2
func (thisConnection *SSHConnection) NewSession() *SSHSession
type SSHSession ¶ added in v1.8.2
type SSHSession struct {
// contains filtered or unexported fields
}
func (*SSHSession) BindInputOutput ¶ added in v1.8.2
func (thisSession *SSHSession) BindInputOutput() error
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)
ExecuteShellCommand 执行命令,当需要 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 (thisSession *SSHSession) GetShellCommandResult(prompt string, moreCommand string, clearLine string) string
func (*SSHSession) SendShellCommand ¶ added in v1.8.2
func (thisSession *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.