tunnel

package
v0.0.0-...-5a1019b Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSHConn

type SSHConn struct {
	NetworkType       string
	ServerAddr        string
	LocalAddr         string
	RemoteAddr        string
	Username          string
	SSHPrivateKeyFile string
	// contains filtered or unexported fields
}

func New

func New(netType string, serverAddr string, localAddr string, remoteAddr string, username string, sshPrivateKeyFile string) *SSHConn

func (*SSHConn) Close

func (sc *SSHConn) Close()

func (*SSHConn) GetLocalAddress

func (sc *SSHConn) GetLocalAddress() string

func (*SSHConn) Open

func (sc *SSHConn) Open() error

func (*SSHConn) RunCommand

func (sc *SSHConn) RunCommand(cmd string) ([]byte, []byte, error)

RunCommand runs a command on the machine and returns stdout and stderr separately

func (*SSHConn) UploadFile

func (sc *SSHConn) UploadFile(localFile string, remoteFilePath string, mode os.FileMode) error

Upload writes a file to the machine

Jump to

Keyboard shortcuts

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