Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PortForward ¶
type PortForward struct {
// contains filtered or unexported fields
}
PortForward encapsulates all K8 portforwarding coordination.
func StartPortForward ¶
func StartPortForward(config clientcmd.ClientConfig, req PortForwardRequest) (*PortForward, error)
StartPortForward starts a portforward connection to a pod that is backing the requested service. If the connection was successfully established a PortForward will be returned, which exposes as methods: - The local port it is listening on - A channel which will be closed when the backing connection is closed (ex: terminated due to inactivity). - A Close method explictely close the connection.
Returns an error if the connection could not be established.
func (*PortForward) LocalPort ¶
func (p *PortForward) LocalPort() string
LocalPort returns the local port used by the port forward struct.
func (*PortForward) StoppedChannel ¶
func (p *PortForward) StoppedChannel() <-chan struct{}
StoppedChannel returns a channel that will be closed when the underlying connection has been closed.
type PortForwardRequest ¶
type PortForwardRequest struct { Context string // Namespace the service runs in. Will be "default" if left blank. Namespace string // Service name. Service string // Service port. Port string }
PortForwardRequest wraps the information required to portforward to a pod. Implements fmt.Stringer so the structure can easily be printed for logging.
func (PortForwardRequest) String ¶
func (p PortForwardRequest) String() string
String func to print the request.