portforward

package
v0.4.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager manages a kubectl port-forward subprocess and exposes a localhost endpoint

func New

func New(kubectl string, log *logger.Logger) *Manager

New creates a new PortForwardManager

func (*Manager) Start

func (m *Manager) Start(namespace, serviceName string, remotePort, preferredLocalPort int) (string, error)

Start starts port-forward to the given service; returns "127.0.0.1:<port>" If already running, this is a no-op and returns the existing endpoint

func (*Manager) StartDetached

func (m *Manager) StartDetached(namespace, serviceName string, remotePort, preferredLocalPort int) (string, int, error)

StartDetached starts port-forward as a detached process that survives the parent process exiting. Returns the endpoint and the PID of the subprocess. The caller is responsible for killing the process when done.

func (*Manager) Stop

func (m *Manager) Stop()

Stop stops the active port-forward if running

Jump to

Keyboard shortcuts

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