dstconn

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePublicKey

func ParsePublicKey(pubKey string) (gossh.PublicKey, error)

Opposite of gossh.MarshalAuthorizedKey

Types

type ClosingConnCopier added in v0.0.3

type ClosingConnCopier struct{}

func (ClosingConnCopier) CopyAndClose added in v0.0.3

func (c ClosingConnCopier) CopyAndClose(dstConn net.Conn, srcConn net.Conn)

type ConnCopier

type ConnCopier interface {
	CopyAndClose(dstConn net.Conn, srcConn net.Conn)
}

type ConnectionBrokenErr added in v0.0.4

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

ConnectionBrokenErr indicates that Factory needs to be recreated

type Factory

type Factory interface {
	NewConn(net.IP, int) (net.Conn, error)
	NewConnCopier(logTag string) ConnCopier

	NewListener() (net.Listener, error)
}

type Local added in v0.0.4

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

func NewLocal added in v0.0.4

func NewLocal(logger Logger) Local

func (Local) NewConn added in v0.0.4

func (l Local) NewConn(ip net.IP, port int) (net.Conn, error)

func (Local) NewConnCopier added in v0.0.4

func (l Local) NewConnCopier(logTag string) ConnCopier

func (Local) NewListener added in v0.0.4

func (l Local) NewListener() (net.Listener, error)

type Logger

type Logger interface {
	Error(tag, msg string, args ...interface{})
	Info(tag, msg string, args ...interface{})
	Debug(tag, msg string, args ...interface{})
}

type SSHClient

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

func NewSSHClient

func NewSSHClient(connOpts SSHClientConnOpts, logger Logger) *SSHClient

func (*SSHClient) Connect

func (c *SSHClient) Connect() error

func (*SSHClient) Disconnect

func (c *SSHClient) Disconnect() error

func (*SSHClient) NewConn

func (c *SSHClient) NewConn(ip net.IP, port int) (net.Conn, error)

func (*SSHClient) NewConnCopier

func (c *SSHClient) NewConnCopier(proxyDesc string) ConnCopier

func (*SSHClient) NewListener added in v0.0.4

func (c *SSHClient) NewListener() (net.Listener, error)

type SSHClientConnOpts

type SSHClientConnOpts struct {
	User             string
	Host             string
	PrivateKeyPEM    string
	HostPublicKeyAuf string // in authorized_hosts format
}

type SSHConnCopier

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

func NewSSHConnCopier

func NewSSHConnCopier(logTagSuffix string, logger Logger) SSHConnCopier

func (SSHConnCopier) CopyAndClose

func (c SSHConnCopier) CopyAndClose(dstConn, srcConn net.Conn)

type SSHKey

type SSHKey struct {
	PrivateKey string
	PublicKey  string
}

type SSHKeyGenerator

type SSHKeyGenerator struct{}

func NewSSHKeyGenerator

func NewSSHKeyGenerator() SSHKeyGenerator

func (SSHKeyGenerator) Generate

func (g SSHKeyGenerator) Generate() (SSHKey, error)

Jump to

Keyboard shortcuts

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