sshtun

package module
v0.0.0-...-5f75ea1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnState

type ConnState int
const (
	// ConnStateNew represents a new connection.
	ConnStateNew ConnState = iota

	// ConnStateConnected represents a connected connection.
	ConnStateConnected

	// ConnStateDisconnected represents a disconnected connection.
	ConnStateDisconnected

	// ConnStateError represents an errored connection.
	ConnStateError

	ConnStateKeepAlive
)

type ConnStateMessage

type ConnStateMessage struct {
	State ConnState
	Err   error
	Msg   string
}

type SSHConfig

type SSHConfig struct {
	Host            string
	Port            int
	User            string
	Auth            ssh.AuthMethod
	HostKeyCallback ssh.HostKeyCallback
}

type SSHTunnel

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

func NewSSHTunnel

func NewSSHTunnel(conf SSHConfig, localPort int, destination string, options ...TunnelOption) (*SSHTunnel, error)

func (*SSHTunnel) Close

func (t *SSHTunnel) Close()

func (*SSHTunnel) ConnState

func (t *SSHTunnel) ConnState() <-chan ConnStateMessage

func (*SSHTunnel) Start

func (t *SSHTunnel) Start() error

type TunnelConfig

type TunnelConfig struct {
	LocalPort   int
	Destination string
	Logf        func(string, ...any)
}

TunnelConfig is the configuration for the tunnel.

type TunnelOption

type TunnelOption func(*TunnelConfig)

func WithLogger

func WithLogger(logf func(string, ...any)) TunnelOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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