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 RawList ¶ added in v1.10.0
type RawList struct {
// contains filtered or unexported fields
}
RawList holds the raw subscribers to any K8s resource / object changes in the K8s watchers.
func (*RawList) NotifyAdd ¶ added in v1.10.0
func (l *RawList) NotifyAdd(obj interface{})
NotifyAdd notifies all the subscribers of an add event to an object.
func (*RawList) NotifyDelete ¶ added in v1.10.0
func (l *RawList) NotifyDelete(obj interface{})
NotifyDelete notifies all the subscribers of an update event to an object.
func (*RawList) NotifyUpdate ¶ added in v1.10.0
func (l *RawList) NotifyUpdate(oldObj, newObj interface{})
NotifyUpdate notifies all the subscribers of an update event to an object.
func (*RawList) Register ¶ added in v1.10.0
func (l *RawList) Register(cb cache.ResourceEventHandler)
Register registers the raw event handler as a subscriber.
type ServiceHandler ¶ added in v1.10.0
type ServiceHandler interface { OnAdd(*slim_corev1.Service) OnUpdate(oldObj, newObj *slim_corev1.Service) OnDelete(*slim_corev1.Service) }
ServiceHandler is implemented by event handlers responding to K8s Service events.
type ServiceList ¶ added in v1.10.0
type ServiceList struct {
// contains filtered or unexported fields
}
ServiceList holds the ServiceHandler subscribers that are notified when reacting to K8s Service resource / object changes in the K8s watchers.
func NewService ¶ added in v1.10.0
func NewService() *ServiceList
NewService creates a new subscriber list for ServiceHandlers.
func (*ServiceList) NotifyAdd ¶ added in v1.10.0
func (l *ServiceList) NotifyAdd(svc *slim_corev1.Service)
NotifyAdd notifies all the subscribers of an add event to a service.
func (*ServiceList) NotifyDelete ¶ added in v1.10.0
func (l *ServiceList) NotifyDelete(svc *slim_corev1.Service)
NotifyDelete notifies all the subscribers of an update event to a service.
func (*ServiceList) NotifyUpdate ¶ added in v1.10.0
func (l *ServiceList) NotifyUpdate(oldSvc, newSvc *slim_corev1.Service)
NotifyUpdate notifies all the subscribers of an update event to a service.
func (*ServiceList) Register ¶ added in v1.10.0
func (l *ServiceList) Register(s ServiceHandler)
Register registers ServiceHandler as a subscriber for reacting to Service objects into the list.