Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Locator ¶
type Locator interface {
// Locate returns the pod name and ports for port forwarding.
Locate(ctx context.Context) (string, []string, error)
}
Locator is the interface for discovering pods or services in Kubernetes.
func BuildLocator ¶
func BuildLocator(resource string, namespace string, ports []string, client kubernetes.Interface) (Locator, error)
BuildLocator creates the appropriate locator based on the resource string. Supported formats: - "pod-name" - direct pod reference - "svc/service-name" or "service/service-name" - service reference
type PodLocator ¶
type PodLocator struct {
// contains filtered or unexported fields
}
PodLocator locates a specific pod by name and returns its port mappings.
func NewPodLocator ¶
func NewPodLocator(podName string, namespace string, ports []string, client kubernetes.Interface) (*PodLocator, error)
NewPodLocator creates a new pod locator for the specified pod name.
type ServiceLocator ¶
type ServiceLocator struct {
// contains filtered or unexported fields
}
ServiceLocator locates a pod backing a service and maps service ports to pod ports.
func NewServiceLocator ¶
func NewServiceLocator(svcName string, namespace string, ports []string, client kubernetes.Interface) (*ServiceLocator, error)
NewServiceLocator creates a new service locator for the specified service name.
Click to show internal directories.
Click to hide internal directories.