Help us shape the future of Go! Take the 2026 Go Developer Survey

portforward

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package portforward provides Kubernetes port-forwarding utilities for the CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PickFreePort

func PickFreePort() (port int, err error)

PickFreePort asks the kernel for a free open port that is ready to use.

Types

type PortForward

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

PortForward provides port-forwarding functionality to results api service, so cli users would not bother to open a new terminal and type `kubectrl port-forward` manually

func NewPortForward

func NewPortForward() (*PortForward, error)

NewPortForward create a new PortForward to do port-forwarding staff

func (*PortForward) ForwardPortBackground

func (pf *PortForward) ForwardPortBackground(stopChan <-chan struct{}, port int) error

ForwardPortBackground do port-forwarding in background. stopChan control when port-forwarding stops, port specify which port on localhost port-forwarding will occupy

Jump to

Keyboard shortcuts

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