subscriber

package
v1.15.6 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 5 Imported by: 5

Documentation

Overview

Package subscriber implements a mechanism to represent K8s watcher subscribers and allows K8s events to objects / resources to notify their respective subscribers. The intent is to allow the K8s watchers to consolidate all the event handling from various subsystems into one place.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CESHandler

type CESHandler interface {
	OnAdd(ces *cilium_v2a1.CiliumEndpointSlice)
	OnUpdate(oldCES, newCES *cilium_v2a1.CiliumEndpointSlice)
	OnDelete(ces *cilium_v2a1.CiliumEndpointSlice)
}

CESHandler is implemented by event handlers responding to CiliumEndpointSlice events.

type CESList

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

CESList holds the CES subscribers to any CiliumEndpointSlice resource / object changes in the K8s watchers.

func NewCES

func NewCES() *CESList

NewCES creates a new ces subscriber list.

func (*CESList) NotifyAdd

func (l *CESList) NotifyAdd(ces *cilium_v2a1.CiliumEndpointSlice)

NotifyAdd notifies all the subscribers of an add event to an object.

func (*CESList) NotifyDelete

func (l *CESList) NotifyDelete(ces *cilium_v2a1.CiliumEndpointSlice)

NotifyDelete notifies all the subscribers of a delete event to an object.

func (*CESList) NotifyUpdate

func (l *CESList) NotifyUpdate(oldCES, newCES *cilium_v2a1.CiliumEndpointSlice)

NotifyUpdate notifies all the subscribers of an update event to an object.

func (*CESList) Register

func (l *CESList) Register(c CESHandler)

Register registers the CES event handler as a subscriber.

type RawChain

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

RawChain holds the raw subscribers to any K8s resource / object changes in the K8s watchers.

RawChain itself is an implementation of cache.ResourceEventHandler with an additional Register method for attaching children subscribers to the chain.

func NewRawChain

func NewRawChain() *RawChain

NewRaw creates a new raw subscriber list.

func (*RawChain) OnAdd

func (l *RawChain) OnAdd(obj interface{}, isInInitialList bool)

NotifyAdd notifies all the subscribers of an add event to an object.

func (*RawChain) OnDelete

func (l *RawChain) OnDelete(obj interface{})

NotifyDelete notifies all the subscribers of an update event to an object.

func (*RawChain) OnUpdate

func (l *RawChain) OnUpdate(oldObj, newObj interface{})

NotifyUpdate notifies all the subscribers of an update event to an object.

func (*RawChain) Register

func (l *RawChain) Register(cb cache.ResourceEventHandler)

Register registers the raw event handler as a subscriber.

type Service

type Service interface {
	OnAddService(*slim_corev1.Service) error
	OnUpdateService(oldObj, newObj *slim_corev1.Service) error
	OnDeleteService(*slim_corev1.Service) error
}

Service is implemented by event handlers responding to K8s Service events.

type ServiceChain

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

ServiceChain holds the subscriber.Service implementations that are notified when reacting to K8s Service resource / object changes in the K8s watchers.

ServiceChain itself is an implementation of subscriber.Service with an additional Register method for attaching children subscribers to the chain.

func NewServiceChain

func NewServiceChain() *ServiceChain

NewServiceChain

func (*ServiceChain) OnAddService

func (l *ServiceChain) OnAddService(svc *slim_corev1.Service) error

OnAddService notifies all the subscribers of an add event to a service.

func (*ServiceChain) OnDeleteService

func (l *ServiceChain) OnDeleteService(svc *slim_corev1.Service) error

OnDeleteService notifies all the subscribers of an update event to a service.

func (*ServiceChain) OnUpdateService

func (l *ServiceChain) OnUpdateService(oldSvc, newSvc *slim_corev1.Service) error

OnUpdateService notifies all the subscribers of an update event to a service.

func (*ServiceChain) Register

func (l *ServiceChain) Register(s Service)

Register registers ServiceHandler as a subscriber for reacting to Service objects into the list.

Jump to

Keyboard shortcuts

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