portforwarder

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package portforwarder implements the logic to create a Port Forwarder that takes a stream from the virtual kubelet and forwards it to an offloaded pod

Index

Constants

View Source
const PortForwardProtocolV1Name = "portforward.k8s.io"

PortForwardProtocolV1Name is the subprotocol used for port forwarding.

Variables

View Source
var ErrLostConnectionToPod = errors.New("lost connection to pod")

ErrLostConnectionToPod is the variable used for error handling.

Functions

This section is empty.

Types

type ForwardedPort

type ForwardedPort struct {
	Local  uint16
	Remote uint16
}

ForwardedPort contains a Local:Remote port pairing.

type PortForwarder

type PortForwarder struct {
	Ready chan struct{}
	// contains filtered or unexported fields
}

PortForwarder gets an input stream and forward it to a remote pod via an upgraded HTTP request.

func New

func New(dialer httpstream.Dialer, ports []string, stopChan <-chan struct{}, readyChan chan struct{},
	out, errOut io.Writer, stream io.ReadWriteCloser) (*PortForwarder, error)

New creates a new PortForwarder with localhost listen addresses.

func NewOnAddresses

func NewOnAddresses(dialer httpstream.Dialer, addresses, ports []string, stopChan <-chan struct{}, readyChan chan struct{},
	out, errOut io.Writer, stream io.ReadWriteCloser) (*PortForwarder, error)

NewOnAddresses creates a new PortForwarder with custom listen addresses.

func (*PortForwarder) ForwardPorts

func (pf *PortForwarder) ForwardPorts() error

ForwardPorts formats and executes a port forwarding request. The connection will remain open until stopChan is closed.

Jump to

Keyboard shortcuts

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