Documentation
¶
Index ¶
- type ServiceAPI
- func (s *ServiceAPI) GetServiceByName(ctx context.Context, namespace, name string) (*corev1.Service, error)
- func (s *ServiceAPI) ListServicesByField(ctx context.Context, namespace string, fieldSelector string) ([]corev1.Service, error)
- func (s *ServiceAPI) ListServicesByLabel(ctx context.Context, namespace string, labelSelector string) ([]corev1.Service, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceAPI ¶
type ServiceAPI struct {
// contains filtered or unexported fields
}
ServiceAPI provides high-level methods for retrieving Kubernetes services.
func NewServiceAPI ¶
func NewServiceAPI(client kubernetes.Interface) *ServiceAPI
NewServiceAPI creates a new ServiceAPI instance using the provided client.
func (*ServiceAPI) GetServiceByName ¶
func (s *ServiceAPI) GetServiceByName(ctx context.Context, namespace, name string) (*corev1.Service, error)
GetServiceByName retrieves a specific Service by namespace and name.
Parameters:
- ctx: Context for cancellation.
- namespace: Namespace of the service (must be non-empty).
- name: Name of the service (must be non-empty).
Returns the matched *corev1.Service or an error if not found or invalid.
func (*ServiceAPI) ListServicesByField ¶
func (s *ServiceAPI) ListServicesByField(ctx context.Context, namespace string, fieldSelector string) ([]corev1.Service, error)
ListServicesByField lists services by namespace and field selector.
Parameters:
- ctx: Context for cancellation.
- namespace: Namespace scope.
- fieldSelector: Kubernetes field selector syntax.
Returns all matching services or an error.
func (*ServiceAPI) ListServicesByLabel ¶
func (s *ServiceAPI) ListServicesByLabel(ctx context.Context, namespace string, labelSelector string) ([]corev1.Service, error)
ListServicesByLabel lists services by namespace and label selector.
Parameters:
- ctx: Context for cancellation.
- namespace: Namespace scope.
- labelSelector: Kubernetes label selector syntax.
Returns all matching services or an error.
Click to show internal directories.
Click to hide internal directories.