subscriber

package
v0.0.0-...-030b38e Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

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 CCEEndpoint

type CCEEndpoint interface {
	OnAddCCEEndpoint(node *ccev2.CCEEndpoint) error
	OnUpdateCCEEndpoint(oldObj, newObj *ccev2.CCEEndpoint) error
	OnDeleteCCEEndpoint(node *ccev2.CCEEndpoint) error
}

CCEEndpoint is implemented by event handlers responding to CCEEndpoint events.

type CCEEndpointChain

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

CCEEndpointChain holds the subsciber.CCEEndpoint implementations that are notified when reacting to CCEEndpoint resource / object changes in the K8s watchers.

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

func NewCCEEndpointChain

func NewCCEEndpointChain() *CCEEndpointChain

NewCCEEndpointChain creates a CCEEndpointChain ready for its Register method to be called.

func (*CCEEndpointChain) OnAddCCEEndpoint

func (l *CCEEndpointChain) OnAddCCEEndpoint(node *ccev2.CCEEndpoint) error

OnAddCCEEndpoint notifies all the subscribers of an add event to a CCEEndpoint.

func (*CCEEndpointChain) OnDeleteCCEEndpoint

func (l *CCEEndpointChain) OnDeleteCCEEndpoint(node *ccev2.CCEEndpoint) error

OnDeleteCCEEndpoint notifies all the subscribers of an update event to a CCEEndpoint.

func (*CCEEndpointChain) OnUpdateCCEEndpoint

func (l *CCEEndpointChain) OnUpdateCCEEndpoint(oldNode, newNode *ccev2.CCEEndpoint) error

OnUpdateCCEEndpoint notifies all the subscribers of an update event to a CCEEndpoint.

func (*CCEEndpointChain) Register

func (l *CCEEndpointChain) Register(s CCEEndpoint)

Register registers s as a subscriber for reacting to CCEEndpoint objects into the list.

type ENI

type ENI interface {
	OnAddENI(node *ccev2.ENI) error
	OnUpdateENI(oldObj, newObj *ccev2.ENI) error
	OnDeleteENI(node *ccev2.ENI) error
}

ENI is implemented by event handlers responding to ENI events.

type ENIChain

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

ENIChain holds the subsciber.ENI implementations that are notified when reacting to ENI resource / object changes in the K8s watchers.

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

func NewENIChain

func NewENIChain() *ENIChain

NewENIChain creates a ENIChain ready for its Register method to be called.

func (*ENIChain) OnAddENI

func (l *ENIChain) OnAddENI(node *ccev2.ENI) error

OnAddENI notifies all the subscribers of an add event to a ENI.

func (*ENIChain) OnDeleteENI

func (l *ENIChain) OnDeleteENI(node *ccev2.ENI) error

OnDeleteENI notifies all the subscribers of an update event to a ENI.

func (*ENIChain) OnUpdateENI

func (l *ENIChain) OnUpdateENI(oldNode, newObj *ccev2.ENI) error

OnUpdateENI notifies all the subscribers of an update event to a ENI.

func (*ENIChain) Register

func (l *ENIChain) Register(s ENI)

Register registers s as a subscriber for reacting to ENI objects into the list.

type NetResourceSet

type NetResourceSet interface {
	OnAddNetResourceSet(node *ccev2.NetResourceSet, swg *lock.StoppableWaitGroup) error
	OnUpdateNetResourceSet(oldObj, newObj *ccev2.NetResourceSet, swg *lock.StoppableWaitGroup) error
	OnDeleteNetResourceSet(node *ccev2.NetResourceSet, swg *lock.StoppableWaitGroup) error
}

NetResourceSet is implemented by event handlers responding to NetResourceSet events.

type NetResourceSetChain

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

NetResourceSetChain holds the subsciber.NetResourceSet implementations that are notified when reacting to NetResourceSet resource / object changes in the K8s watchers.

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

func NewNetResourceSetChain

func NewNetResourceSetChain() *NetResourceSetChain

NewNetResourceSetChain creates a NetResourceSetChain ready for its Register method to be called.

func (*NetResourceSetChain) OnAddNetResourceSet

func (l *NetResourceSetChain) OnAddNetResourceSet(node *ccev2.NetResourceSet, swg *lock.StoppableWaitGroup) error

OnAddNetResourceSet notifies all the subscribers of an add event to a NetResourceSet.

func (*NetResourceSetChain) OnDeleteNetResourceSet

func (l *NetResourceSetChain) OnDeleteNetResourceSet(node *ccev2.NetResourceSet, swg *lock.StoppableWaitGroup) error

OnDeleteNetResourceSet notifies all the subscribers of an update event to a NetResourceSet.

func (*NetResourceSetChain) OnUpdateNetResourceSet

func (l *NetResourceSetChain) OnUpdateNetResourceSet(oldNode, newNode *ccev2.NetResourceSet, swg *lock.StoppableWaitGroup) error

OnUpdateNetResourceSet notifies all the subscribers of an update event to a NetResourceSet.

func (*NetResourceSetChain) Register

func (l *NetResourceSetChain) Register(s NetResourceSet)

Register registers s as a subscriber for reacting to NetResourceSet objects into the list.

type Node

type Node interface {
	OnAddNode(*v1.Node, *lock.StoppableWaitGroup) error
	OnUpdateNode(oldObj, newObj *v1.Node, swg *lock.StoppableWaitGroup) error
	OnDeleteNode(*v1.Node, *lock.StoppableWaitGroup) error
}

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

type NodeChain

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

NodeChain holds the subsciber.Node implementations that are notified when reacting to K8s Node resource / object changes in the K8s watchers.

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

func NewNodeChain

func NewNodeChain() *NodeChain

NewNodeChain creates a NodeChain ready for it's Register method to be called.

func (*NodeChain) OnAddNode

func (l *NodeChain) OnAddNode(node *v1.Node, swg *lock.StoppableWaitGroup) error

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

func (*NodeChain) OnDeleteNode

func (l *NodeChain) OnDeleteNode(node *v1.Node, swg *lock.StoppableWaitGroup) error

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

func (*NodeChain) OnUpdateNode

func (l *NodeChain) OnUpdateNode(oldNode, newNode *v1.Node,
	swg *lock.StoppableWaitGroup) error

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

func (*NodeChain) Register

func (l *NodeChain) Register(s Node)

Register registers NodeHandler as a subscriber for reacting to Node objects into the list.

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{})

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.

Jump to

Keyboard shortcuts

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