Documentation ¶
Overview ¶
Package dnet contains alternative net.Conn implementations.
Index ¶
- func NewK8sPortForwardDialer(logCtx context.Context, kubeFlags *kates.ConfigFlags, ...) (func(context.Context, string) (net.Conn, error), error)
- func NewLoopbackListener() (net.Listener, func(net.Conn) error)
- type AmbassadorCloudTunnel
- type Conn
- func AcceptFromAmbassadorCloud(systema manager.ManagerProxy_HandleConnectionServer) (interceptID string, conn Conn, err error)
- func DialFromAmbassadorCloud(ctx context.Context, managerClient manager.ManagerProxyClient, ...) (Conn, error)
- func WrapAmbassadorCloudTunnel(impl AmbassadorCloudTunnel) Conn
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.
Types ¶
type AmbassadorCloudTunnel ¶
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.