ssh

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tunnel

type Tunnel struct {
	// contains filtered or unexported fields
}

Tunnel represents an SSH tunnel that forwards a local port to a remote MySQL server.

func NewTunnel

func NewTunnel(cfg *config.SSHConfig, remoteHost string, remotePort int) (*Tunnel, error)

NewTunnel establishes an SSH tunnel and returns a Tunnel that forwards connections from a random local port to remoteHost:remotePort through the SSH server.

func (*Tunnel) Close

func (t *Tunnel) Close() error

Close shuts down the tunnel.

func (*Tunnel) IsClosed

func (t *Tunnel) IsClosed() bool

IsClosed returns whether the tunnel has been closed.

func (*Tunnel) LocalAddr

func (t *Tunnel) LocalAddr() string

LocalAddr returns the local address that MySQL should connect to.

func (*Tunnel) LocalPort

func (t *Tunnel) LocalPort() int

LocalPort returns the local port number.

Jump to

Keyboard shortcuts

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