dnet

package
v2.4.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package dnet contains alternative net.Conn implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewK8sPortForwardDialer

func NewK8sPortForwardDialer(logCtx context.Context, kubeFlags *kates.ConfigFlags, kubeKatesClient *kates.Client) (func(context.Context, string) (net.Conn, error), error)

NewK8sPortForwardDialer returns a dialer function (matching the signature required by grpc.WithContextDialer) that dials to a port on a Kubernetes Pod, in the manor of `kubectl port-forward`. It returns the direct connection to the apiserver; it does not establish a local port being forwarded from or otherwise pump data over the connection.

func NewLoopbackListener added in v2.3.7

func NewLoopbackListener() (net.Listener, func(net.Conn) error)

NewLoopbackListener returns a net.Listener that rather than listening on a real network interface, waits for you to add new connections to it with the returned AddConn function.

Types

type AmbassadorCloudTunnel

type AmbassadorCloudTunnel interface {
	Send(*systema.Chunk) error
	Recv() (*systema.Chunk, error)
}

AmbassadorCloudTunnel is the intersection of these two interfaces:

systema.SystemAProxy_ReverseConnectionClient
systema.SystemAProxy_ReverseConnectionServer

type Conn

type Conn interface {
	net.Conn

	// Wait until either the connection is Close()d, or one of Read() or Write() encounters an
	// error (*not* counting errors caused by deadlines).  If this returns because Close() was
	// called, nil is returned; otherwise the triggering error is returned.
	//
	// Essentially: Wait until the connection is finished.
	Wait() error
}

Conn is a net.Conn, plus a Wait() method.

func AcceptFromAmbassadorCloud

func AcceptFromAmbassadorCloud(systema manager.ManagerProxy_HandleConnectionServer) (interceptID string, conn Conn, err error)

AcceptFromAmbassadorCloud is used by a Telepresence manger to accept a connection to an intercept for a preview URL from a Ambassador Cloud.

It is the counterpart to DialFromAmbassadorCloud.

func DialFromAmbassadorCloud

func DialFromAmbassadorCloud(ctx context.Context, managerClient manager.ManagerProxyClient, interceptID string, opts ...grpc.CallOption) (Conn, error)

DialFromAmbassadorCloud is used by Ambassador Cloud to dial to the manager, initiating a connection to an intercept for a preview URL.

It is the counterpart to AcceptFromAmbassadorCloud.

func WrapAmbassadorCloudTunnel

func WrapAmbassadorCloudTunnel(impl AmbassadorCloudTunnel) Conn

WrapAmbassadorCloudTunnel takes a systema.SystemAProxy_ReverseConnectionClient or systema.SystemAProxy_ReverseConnectionServer and wraps it so that it can be used as a net.Conn.

Jump to

Keyboard shortcuts

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