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 ¶
- type CCEEndpoint
- type CCEEndpointChain
- type ENI
- type ENIChain
- type NetResourceSet
- type NetResourceSetChain
- func (l *NetResourceSetChain) OnAddNetResourceSet(node *ccev2.NetResourceSet, swg *lock.StoppableWaitGroup) error
- func (l *NetResourceSetChain) OnDeleteNetResourceSet(node *ccev2.NetResourceSet, swg *lock.StoppableWaitGroup) error
- func (l *NetResourceSetChain) OnUpdateNetResourceSet(oldNode, newNode *ccev2.NetResourceSet, swg *lock.StoppableWaitGroup) error
- func (l *NetResourceSetChain) Register(s NetResourceSet)
- type Node
- type NodeChain
- type RawChain
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) OnDeleteENI ¶
OnDeleteENI notifies all the subscribers of an update event to a ENI.
func (*ENIChain) OnUpdateENI ¶
OnUpdateENI notifies all the subscribers of an update event to a ENI.
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) OnDeleteNode ¶
NotifyDelete notifies all the subscribers of an update event to a service.
func (*NodeChain) OnUpdateNode ¶
NotifyUpdate notifies all the subscribers of an update event to a service.
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 (*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.