Documentation
¶
Index ¶
- type EventHandler
- type EventHandlerFuncs
- func (e *EventHandlerFuncs) Start(ctx context.Context) error
- func (e *EventHandlerFuncs) Stop()
- func (e *EventHandlerFuncs) WithAddFunc(addfn func(obj interface{})) *EventHandlerFuncs
- func (e *EventHandlerFuncs) WithDeleteFunc(deletefn func(obj interface{})) *EventHandlerFuncs
- func (e *EventHandlerFuncs) WithUpdateFunc(updatefn func(updated interface{})) *EventHandlerFuncs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
EventHandler can handle notifications for events that happen to a resource. Start will be waiting for the events notification which is responsible for invoking the registered user defined functions. Stop used to stop the watcher.
type EventHandlerFuncs ¶
type EventHandlerFuncs struct { ListOptions *cr.ListOptions K8sObject k8s.ObjectList Cfg *rest.Config // contains filtered or unexported fields }
EventHandlerFuncs is an adaptor to let you easily specify as many or as few of functions to invoke while getting notification from watcher
func (*EventHandlerFuncs) Start ¶
func (e *EventHandlerFuncs) Start(ctx context.Context) error
Start triggers the registered methods based on the event received for particular k8s resources
func (*EventHandlerFuncs) Stop ¶
func (e *EventHandlerFuncs) Stop()
Stop triggers stopping a particular k8s watch resources
func (*EventHandlerFuncs) WithAddFunc ¶
func (e *EventHandlerFuncs) WithAddFunc(addfn func(obj interface{})) *EventHandlerFuncs
SetAddFunc used to set action on create event
func (*EventHandlerFuncs) WithDeleteFunc ¶
func (e *EventHandlerFuncs) WithDeleteFunc(deletefn func(obj interface{})) *EventHandlerFuncs
SetDeleteFunc sets action for delete events
func (*EventHandlerFuncs) WithUpdateFunc ¶
func (e *EventHandlerFuncs) WithUpdateFunc(updatefn func(updated interface{})) *EventHandlerFuncs
SetUpdateFunc sets action for any update events