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
}
PortForwarder can manage a port forwarding session.
func NewPortForwarder ¶
func NewPortForwarder(restConfig *rest.Config, logger logger, opts PortForwardingOpts) (*PortForwarder, error)
NewPortForwarder creates a PortForwarder.
func (*PortForwarder) Address ¶
func (p *PortForwarder) Address() string
Address returns an address for communicating with a port-forwarded pod.
func (*PortForwarder) Forward ¶
func (p *PortForwarder) Forward(ctx context.Context) error
Forward attempts to initiate port forwarding a pod and port using the configured namespace and labels. An error is returned if a port forwarding session could not be started. If no error is returned, the Address method can be used to communicate with the pod, and the Stop and KeepAlive methods can be used to manage the lifetime of the port forwarding session.
func (*PortForwarder) KeepAlive ¶
func (p *PortForwarder) KeepAlive(ctx context.Context)
KeepAlive can be used to restart the port forwarding session in the background.
func (*PortForwarder) Stop ¶
func (p *PortForwarder) Stop()
Stop terminates a port forwarding session.