cilium: github.com/cilium/cilium/pkg/service/healthserver Index | Files

package healthserver

import "github.com/cilium/cilium/pkg/service/healthserver"

Index

Package Files

healthserver.go healthserver_mock.go

type MockHealthHTTPServerFactory Uses

type MockHealthHTTPServerFactory struct {
    // contains filtered or unexported fields
}

MockHealthHTTPServerFactory mocks the healthHTTPServerFactory interface

func NewMockHealthHTTPServerFactory Uses

func NewMockHealthHTTPServerFactory() *MockHealthHTTPServerFactory

NewMockHealthHTTPServerFactory creates a new health server factory for testing

func (*MockHealthHTTPServerFactory) ServiceByPort Uses

func (m *MockHealthHTTPServerFactory) ServiceByPort(port uint16) *Service

ServiceByPort returns the service for a given health check node port

type Service Uses

type Service struct {
    Service        ServiceName `json:"service"`
    LocalEndpoints int         `json:"localEndpoints"`
}

Service represents the object returned by the health server

func NewService Uses

func NewService(ns, name string, localEndpoints int) *Service

NewService creates a new service

type ServiceHealthServer Uses

type ServiceHealthServer struct {
    // contains filtered or unexported fields
}

ServiceHealthServer manages HTTP health check ports. For each added service, it opens a HTTP server on the specified HealthCheckNodePort and either responds with 200 OK if there are local endpoints for the service, or with 503 Service Unavailable if the service does not have any local endpoints.

func New Uses

func New() *ServiceHealthServer

New creates a new health service server which services health checks by serving an HTTP endpoint for each service on the given HealthCheckNodePort.

func WithHealthHTTPServerFactory Uses

func WithHealthHTTPServerFactory(healthHTTPServerFactory healthHTTPServerFactory) *ServiceHealthServer

WithHealthHTTPServerFactory creates a new health server with a specific health server factory for testing purposes.

func (*ServiceHealthServer) DeleteService Uses

func (s *ServiceHealthServer) DeleteService(svcID lb.ID)

DeleteService stops the health server for the given service with 'svcID'. Access to this method is not synchronized. It is the caller's responsibility to ensure this method is called in a thread-safe manner.

func (*ServiceHealthServer) UpsertService Uses

func (s *ServiceHealthServer) UpsertService(svcID lb.ID, ns, name string, localEndpoints int, port uint16)

UpsertService inserts or updates a service health check server on 'port'. If 'port' is zero, the listener for the added service is stopped. Access to this method is not synchronized. It is the caller's responsibility to ensure this method is called in a thread-safe manner.

type ServiceName Uses

type ServiceName struct {
    Namespace string `json:"namespace"`
    Name      string `json:"name"`
}

ServiceName is the name and namespace of the service

Package healthserver imports 13 packages (graph) and is imported by 3 packages. Updated 2020-08-12. Refresh now. Tools for package owners.