Documentation ¶
Index ¶
- 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
- 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
- type Entrypoint
- type Option
- type SSHJump
- type SSHTunnel
- 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) GetLocalEndpoint() Endpoint
- func (tunnel SSHTunnel) GetRemoteEndpoint() Endpoint
- func (tunnel SSHTunnel) GetServerEndpoint() Endpoint
- func (tunnel *SSHTunnel) Ready() <-chan bool
- func (tunnel *SSHTunnel) SetCommand(cmd string)
- func (tunnel *SSHTunnel) Start() (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthMethodFromPrivateKey ¶
func AuthMethodFromPrivateKey(buffer []byte, passphrase []byte) (_ ssh.AuthMethod, err error)
func AuthMethodFromPrivateKeyFile ¶
func AuthMethodFromPrivateKeyFile(file string, passphrase []byte) (_ ssh.AuthMethod, err error)
func DialSSHWithTimeout ¶
func GenerateRSAKeyPair ¶
GenerateRSAKeyPair creates a key pair
Types ¶
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
func NewEndpoint ¶
func NewEndpoint(s string, options ...EndpointOption) (_ *Endpoint, err error)
func (Endpoint) Authentication ¶
func (endpoint Endpoint) Authentication() []ssh.AuthMethod
type EndpointOption ¶
func EndpointOptionAuth ¶
func EndpointOptionAuth(auth ssh.AuthMethod) EndpointOption
func EndpointOptionKeyFromFile ¶
func EndpointOptionKeyFromFile(filename, passphrase string) EndpointOption
func EndpointOptionKeyFromString ¶
func EndpointOptionKeyFromString(key string, passphrase string) EndpointOption
func EndpointOptionPassword ¶
func EndpointOptionPassword(pass string) EndpointOption
type Entrypoint ¶
type Entrypoint = Endpoint
type Option ¶
func TunnelOptionWithDefaultKeepAlive ¶
func TunnelOptionWithDefaultKeepAlive() Option
func TunnelOptionWithLogger ¶
func TunnelOptionWithLogger(myLogger logger) Option
type SSHTunnel ¶
type SSHTunnel struct {
// contains filtered or unexported fields
}
func NewSSHTunnel ¶
func NewSSHTunnel(tunnel string, auth ssh.AuthMethod, destination string, options ...Option) (_ *SSHTunnel, err error)
NewSSHTunnel creates a ssh tunnel through localhost:0
func NewSSHTunnelFromCfg ¶
func NewSSHTunnelWithLocalBinding ¶
func NewSSHTunnelWithLocalBinding( tunnel string, auth ssh.AuthMethod, destination string, source string, options ...Option, ) (_ *SSHTunnel, err error)
NewSSHTunnelWithLocalBinding creates a ssh tunnel
func (SSHTunnel) GetLocalEndpoint ¶
func (SSHTunnel) GetRemoteEndpoint ¶
func (SSHTunnel) GetServerEndpoint ¶
func (*SSHTunnel) SetCommand ¶
Click to show internal directories.
Click to hide internal directories.