portforwarder

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package portforwarder provides port forwarding between local and Kubernetes.

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Run(o Option, readyChan chan struct{}, stopChan <-chan struct{}) error
}

type Option added in v1.1.0

type Option struct {
	Config              *rest.Config
	SourcePort          int
	TargetNamespace     string
	TargetPodName       string
	TargetContainerPort int
}

Option represents an option of PortForwarder.

type PortForwarder

type PortForwarder struct {
}

func (*PortForwarder) Run added in v0.4.0

func (pf *PortForwarder) Run(o Option, readyChan chan struct{}, stopChan <-chan struct{}) error

Run executes a port forwarder.

It returns nil if stopChan has been closed or connection has lost. It returns an error if it could not connect to the pod.

It will close the readyChan when the port forwarder is ready. Caller can stop the port forwarder by closing the stopChan.

Directories

Path Synopsis
Package mock_portforwarder is a generated GoMock package.
Package mock_portforwarder is a generated GoMock package.

Jump to

Keyboard shortcuts

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