ssh

package
v0.0.15 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	// Server host address
	Host string
	// Server port
	Port int
}

Endpoint represents a Host/port combo

func (*Endpoint) String

func (endpoint *Endpoint) String() string

type SSH

type SSH struct {
	Local  *Endpoint
	Server *Endpoint
	Remote *Endpoint

	Config *ssh.ClientConfig
}

SSH represents a local/remote/tunnel combination

func NewTunnel

func NewTunnel(host, tunnelHost, tunnelUser,
	tunnelPassword, tunnelPrivateKey string, tunnelRequired bool) (*SSH, error)

NewTunnel will create a string of the form "host:port", and will establish an SSH tunnel if necessary to create a string that can be used to connect to a remote machine

func (*SSH) Start

func (tunnel *SSH) Start(wg *sync.WaitGroup) error

Start opens a persistent tunnel

Jump to

Keyboard shortcuts

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