forwarder

package
v0.9.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option struct {
	LocalPort   int    // the local port for forwarding
	RemotePort  int    // the remote port port for forwarding
	Namespace   string // the k8s namespace metadata
	PodName     string // the k8s pod metadata
	ServiceName string // the k8s service metadata
	Source      string // the k8s source string, eg: svc/my-nginx-svc po/my-nginx-66b6c48dd5-ttdb2
}

type PodOption

type PodOption struct {
	LocalPort int    // the local port for forwarding
	PodPort   int    // the k8s pod port
	Pod       v1.Pod // the k8s pod metadata
}

type Result

type Result struct {
	Close func()                                        // close the port forwarding
	Ready func() ([][]portforward.ForwardedPort, error) // block till the forwarding ready
	Wait  func()                                        // block and listen IOStreams close signal
}

func WithForwarders

func WithForwarders(ctx context.Context, config *rest.Config, options []*Option) (*Result, error)

WithForwarders forward ports per the options. Cancel the context will stop the forwarder.

Jump to

Keyboard shortcuts

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