net

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GuessSubnets

func GuessSubnets(remoteIPs []net.IP, excludedIPs []net.IP) []net.IPNet

func LocalIPs

func LocalIPs() ([]net.IP, error)

func SubnetsAsString

func SubnetsAsString(subnets []net.IPNet) string

Types

type ConfiguredSubnets

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

func NewConfiguredSubnets

func NewConfiguredSubnets(subnets []string) ConfiguredSubnets

func (ConfiguredSubnets) Subnets

func (s ConfiguredSubnets) Subnets() ([]net.IPNet, error)

type DNSIPs

type DNSIPs interface {
	DNSIPs() ([]net.IP, error)
}

type DNSOSCache added in v0.0.3

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

DNSOSCache represents DNS caching system that Operating System configures.

func NewDNSOSCache added in v0.0.3

func NewDNSOSCache(logger Logger) DNSOSCache

func (DNSOSCache) Flush added in v0.0.3

func (c DNSOSCache) Flush()

type DNSServer

type DNSServer interface {
	Serve(startedCh chan struct{}) error
	TCPAddr() net.Addr
	UDPAddr() net.Addr
	Shutdown() error
}

type DNSServerFactory

type DNSServerFactory interface {
	NewDNSServer(dstconn.Factory) (DNSServer, error)
	NewDNSOSCache() DNSOSCache
}

type EntryPoint

type EntryPoint interface {
	EntryPoint() (EntryPointSession, error)
	Delete() error
}

type EntryPointSession added in v0.0.3

type EntryPointSession interface {
	Opts() dstconn.SSHClientConnOpts
	Close() error
}

type ForwardingProxy

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

func NewForwardingProxy

func NewForwardingProxy(forwarderFactory forwarder.Factory, dnsServerFactory DNSServerFactory, logger Logger) *ForwardingProxy

func (*ForwardingProxy) Serve

func (o *ForwardingProxy) Serve(dstConnFactory dstconn.Factory, subnets []net.IPNet, dnsIPs []net.IP) error

func (*ForwardingProxy) Shutdown

func (o *ForwardingProxy) Shutdown() error

type KubeEntryPoint

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

func NewKubeEntryPoint

func NewKubeEntryPoint(coreClient kubernetes.Interface, restConfig *rest.Config, namespace string, imageURL string, logger Logger) KubeEntryPoint

func (KubeEntryPoint) Delete

func (f KubeEntryPoint) Delete() error

func (KubeEntryPoint) EntryPoint

func (f KubeEntryPoint) EntryPoint() (EntryPointSession, error)

type KubeEntryPointSession added in v0.0.3

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

func (KubeEntryPointSession) Close added in v0.0.3

func (s KubeEntryPointSession) Close() error

func (KubeEntryPointSession) Opts added in v0.0.3

type KubeListenerService added in v0.0.4

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

func NewKubeListenerService added in v0.0.4

func NewKubeListenerService(
	svcName string, svcType corev1.ServiceType, nsName string,
	portStr string, coreClient kubernetes.Interface, logger Logger) *KubeListenerService

func (*KubeListenerService) Redirect added in v0.0.4

func (s *KubeListenerService) Redirect(targetPort string) error

func (*KubeListenerService) Revert added in v0.0.4

func (s *KubeListenerService) Revert() error

func (*KubeListenerService) Snapshot added in v0.0.4

func (s *KubeListenerService) Snapshot() error

type KubePortForward

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

func NewKubePortForward

func NewKubePortForward(
	pod *corev1.Pod,
	coreClient kubernetes.Interface,
	restConfig *rest.Config,
	logger Logger,
) *KubePortForward

func (KubePortForward) LocalPort added in v0.0.3

func (f KubePortForward) LocalPort() (int, error)

LocalPort should only be called once and after port forwarding is ready

func (KubePortForward) Shutdown added in v0.0.3

func (f KubePortForward) Shutdown() error

func (KubePortForward) Start

func (f KubePortForward) Start(remotePort int, startedCh chan struct{}) error

type KubeSubnets

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

func NewKubeSubnets

func NewKubeSubnets(coreClient kubernetes.Interface, additionalRemoteIPs []string, logger Logger) KubeSubnets

func (KubeSubnets) Subnets

func (s KubeSubnets) Subnets() ([]net.IPNet, 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 ReconnListener added in v0.0.4

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

func NewReconnListener added in v0.0.4

func NewReconnListener(service *KubeListenerService, reconnSSHClient *ReconnSSHClient, logger Logger) *ReconnListener

func (*ReconnListener) Accept added in v0.0.4

func (lis *ReconnListener) Accept() (net.Conn, error)

func (*ReconnListener) Addr added in v0.0.4

func (lis *ReconnListener) Addr() net.Addr

func (*ReconnListener) Close added in v0.0.4

func (lis *ReconnListener) Close() error

type ReconnSSHClient added in v0.0.3

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

func NewReconnSSHClient added in v0.0.3

func NewReconnSSHClient(entryPoint EntryPoint, logger Logger) *ReconnSSHClient

func (*ReconnSSHClient) Connect added in v0.0.3

func (f *ReconnSSHClient) Connect() error

func (*ReconnSSHClient) Disconnect added in v0.0.3

func (f *ReconnSSHClient) Disconnect() error

func (*ReconnSSHClient) NewConn added in v0.0.3

func (f *ReconnSSHClient) NewConn(ip net.IP, port int) (net.Conn, error)

func (*ReconnSSHClient) NewConnCopier added in v0.0.3

func (f *ReconnSSHClient) NewConnCopier(proxyDesc string) dstconn.ConnCopier

func (*ReconnSSHClient) NewListener added in v0.0.4

func (f *ReconnSSHClient) NewListener() (net.Listener, error)

type RemotingProxy

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

func NewRemotingProxy

func NewRemotingProxy(entryPoint EntryPoint, subnets Subnets, dnsIPs DNSIPs, forwardingProxy *ForwardingProxy, logger Logger) *RemotingProxy

func (*RemotingProxy) Serve

func (f *RemotingProxy) Serve() error

func (*RemotingProxy) Shutdown

func (f *RemotingProxy) Shutdown() error

type SSHEntryPoint

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

func NewSSHEntryPoint

func NewSSHEntryPoint(opts dstconn.SSHClientConnOpts) SSHEntryPoint

func (SSHEntryPoint) Delete

func (f SSHEntryPoint) Delete() error

func (SSHEntryPoint) EntryPoint

func (f SSHEntryPoint) EntryPoint() (EntryPointSession, error)

type SSHEntryPointSession added in v0.0.3

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

func (SSHEntryPointSession) Close added in v0.0.3

func (s SSHEntryPointSession) Close() error

func (SSHEntryPointSession) Opts added in v0.0.3

type Subnets

type Subnets interface {
	Subnets() ([]net.IPNet, error)
}

type TCPProxy

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

func NewTCPProxy

func NewTCPProxy(
	origDstResolver forwarder.OriginalDstResolver,
	dstConnFactory dstconn.Factory,
	logger Logger,
) *TCPProxy

func (*TCPProxy) Addr

func (c *TCPProxy) Addr() net.Addr

func (*TCPProxy) Serve

func (c *TCPProxy) Serve(startedCh chan struct{}) error

func (*TCPProxy) ServeListener added in v0.0.4

func (c *TCPProxy) ServeListener(listener net.Listener, startedCh chan struct{}) error

func (*TCPProxy) Shutdown

func (c *TCPProxy) Shutdown() error

type UDPProxy

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

func NewUDPProxy

func NewUDPProxy(
	dstConnFactory dstconn.Factory,
	logger Logger,
) *UDPProxy

func (*UDPProxy) Addr

func (c *UDPProxy) Addr() net.Addr

func (*UDPProxy) Serve

func (c *UDPProxy) Serve(startedCh chan struct{}) error

func (*UDPProxy) Shutdown

func (c *UDPProxy) Shutdown() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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