sshclient

package
v1.6.16-beta-3 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

sshclient ssh client library

Index

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)

Jump to

Keyboard shortcuts

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