Versions in this module Expand all Collapse all v21 v21.11.1 Apr 26, 2022 v21.11.0 Feb 17, 2022 Changes in this version + func AuthMethodFromPrivateKey(buffer []byte, passphrase []byte) (_ ssh.AuthMethod, err error) + func AuthMethodFromPrivateKeyFile(file string, passphrase []byte) (_ ssh.AuthMethod, err error) + func DialSSHWithTimeout(network, addr string, config *ssh.ClientConfig, timeout time.Duration) (_ *ssh.Client, err error) + func GenerateRSAKeyPair(keylen int) (privKey string, pubKey string, err error) + func OnPanic(err *error) func() + func RunCommandInSSHSessionWithTimeout(se *ssh.Session, cmd string, timeout time.Duration) (err error) + type Endpoint struct + func NewEndpoint(s string, options ...EndpointOption) (_ *Endpoint, err error) + func (endpoint Endpoint) Address() string + func (endpoint Endpoint) Authentication() []ssh.AuthMethod + func (endpoint Endpoint) Dump() string + func (endpoint Endpoint) Host() string + func (endpoint Endpoint) Port() int + func (endpoint Endpoint) String() string + func (endpoint Endpoint) User() string + func (endpoint Endpoint) Validate() error + type EndpointOption func(tunnel *Endpoint) error + func EndpointOptionAuth(auth ssh.AuthMethod) EndpointOption + func EndpointOptionKeyFromFile(filename, passphrase string) EndpointOption + func EndpointOptionKeyFromString(key string, passphrase string) EndpointOption + func EndpointOptionPassword(pass string) EndpointOption + type Entrypoint = Endpoint + type Option func(tunnel *SSHTunnel) error + func TunnelOptionWithDefaultKeepAlive() Option + func TunnelOptionWithDialTimeout(timeout time.Duration) Option + func TunnelOptionWithKeepAlive(keepAlive time.Duration) Option + func TunnelOptionWithLogger(myLogger logger) Option + type SSHJump = Endpoint + type SSHTunnel struct + func NewSSHTunnel(tunnel string, auth ssh.AuthMethod, destination string, options ...Option) (_ *SSHTunnel, err error) + func NewSSHTunnelFromCfg(gw SSHJump, target Endpoint, local Entrypoint, options ...Option) (_ *SSHTunnel, err error) + func NewSSHTunnelWithLocalBinding(tunnel string, auth ssh.AuthMethod, destination string, source string, ...) (_ *SSHTunnel, err error) + func (tunnel *SSHTunnel) Close() + func (tunnel *SSHTunnel) Ready() <-chan bool + func (tunnel *SSHTunnel) SetCommand(cmd string) + func (tunnel *SSHTunnel) Start() (err error) + func (tunnel SSHTunnel) GetLocalEndpoint() Endpoint + func (tunnel SSHTunnel) GetRemoteEndpoint() Endpoint + func (tunnel SSHTunnel) GetServerEndpoint() Endpoint