portforwarder

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 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

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

Option represents an option of PortForwarder.

type PortForwarder

type PortForwarder struct {
}

func (*PortForwarder) Run

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