sshtunnel

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TunnelForwarder

type TunnelForwarder struct {
	Host       string `property:"Host"`
	Port       int    `property:"Port"`
	User       string `property:"User"`
	Password   string `property:"Password,category:password"`
	RemoteHost string `property:"Remote Host"`
	RemotePort int    `property:"Remote Port"`
	PrivateKey string `property:"Private Key"`
	// contains filtered or unexported fields
}

TunnelForwarder ssh tunnel

func NewSSHTunnel

func NewSSHTunnel(dsn string, remoteHost string, remotePort int) (*TunnelForwarder, error)

NewSSHTunnel TunnelForwarder

func (*TunnelForwarder) InitUserAuth

func (c *TunnelForwarder) InitUserAuth(user, password string) (*ssh.ClientConfig, error)

InitUserAuth init with user and password

func (*TunnelForwarder) LocalHost

func (c *TunnelForwarder) LocalHost() string

LocalHost get local tunnel host

func (*TunnelForwarder) LocalPort

func (c *TunnelForwarder) LocalPort() int

LocalPort get local tunnel listen port

func (*TunnelForwarder) ParseFromDSN

func (c *TunnelForwarder) ParseFromDSN(DSN string) error

ParseFromDSN parse

func (*TunnelForwarder) ParsePrivateKey

func (c *TunnelForwarder) ParsePrivateKey(keyPath string) (ssh.Signer, error)

ParsePrivateKey parse private key

func (*TunnelForwarder) PrivateKeyPath

func (c *TunnelForwarder) PrivateKeyPath() string

PrivateKeyPath getter

func (*TunnelForwarder) Start

func (c *TunnelForwarder) Start() error

Start start the ssh tunnel

func (*TunnelForwarder) Stop

func (c *TunnelForwarder) Stop()

Stop stop the runloop

Jump to

Keyboard shortcuts

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