controllers

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceEndpoints

type ServiceEndpoints struct {
	Service  *v1.Service
	Endpoint *v1.Endpoints
}

ServiceEndpoints holds the service and its endpoints.

type ServiceMap

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

ServiceMap encapsulates a map with a mutex to protect concurrent access.

func NewServiceMap

func NewServiceMap() *ServiceMap

NewServiceMap creates and returns a new ServiceMap.

func (*ServiceMap) Delete

func (sm *ServiceMap) Delete(namespace, name string)

Delete removes the ServiceEndpoints stored under the given namespace and name.

func (*ServiceMap) Get

func (sm *ServiceMap) Get(namespace, name string) (*ServiceEndpoints, bool)

Get returns the ServiceEndpoints stored under the given namespace and name.

func (*ServiceMap) GetAll

func (sm *ServiceMap) GetAll() map[string]*ServiceEndpoints

GetAll returns a copy of the service mapping.

func (*ServiceMap) Set

func (sm *ServiceMap) Set(namespace, name string, se *ServiceEndpoints)

Set stores the ServiceEndpoints under the given namespace and name.

func (*ServiceMap) SetEndpoint

func (sm *ServiceMap) SetEndpoint(namespace, name string, ep *v1.Endpoints)

SetEndpoint updates the Endpoint for the ServiceEndpoints stored under the given namespace and name.

type ServicesController

type ServicesController struct {
	Clientset *kubernetes.Clientset
	Services  *ServiceMap
	Proxy     nat.ProxyProcessor
}

func (*ServicesController) Start

func (c *ServicesController) Start(ctx context.Context) error

Start initializes the NAT, runs the service and endpoint informers, and cleans up removed services.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL