portforwarder

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PortForwarder

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

func NewPortForwarder

func NewPortForwarder(config *rest.Config, namespace string, pod string, targetPort int, listenAddress string, listenPort int) (*PortForwarder, error)

This function creates Port Forwarder for a Pod After creating Port Forwarder object, call Start() on it to start forwarding channel and Stop() to terminate it

func NewServicePortForwarder

func NewServicePortForwarder(config *rest.Config, namespace string, service string, servicePort int, listenAddress string, listenPort int) (*PortForwarder, error)

This function creates Port Forwarder for a Service by finding first Pod that belongs to the Service, and target Port for requested Service Port. This code is based upon kubectl port-forward implementation After creating Port Forwarder object, call Start() on it to start forwarding channel and Stop() to terminate it

func (*PortForwarder) Start

func (p *PortForwarder) Start() error

Start Port Forwarding channel

func (*PortForwarder) Stop

func (p *PortForwarder) Stop()

Stop Port Forwarding channel

Jump to

Keyboard shortcuts

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