Skip to content

Commit

Permalink
Add method to return a watcher's event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKatsoulis committed Feb 14, 2024
1 parent e052775 commit 4d25383
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions kubernetes/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ type Watcher interface {
// AddEventHandler add event handlers for corresponding event type watched
AddEventHandler(ResourceEventHandler)

// GetEventHandler returns the event handlers for corresponding event type watched
GetEventHandler() ResourceEventHandler

// Store returns the store object for the watcher
Store() cache.Store

Expand Down Expand Up @@ -181,6 +184,11 @@ func (w *watcher) AddEventHandler(h ResourceEventHandler) {
w.handler = h
}

// GetEventHandler returns the watcher's event handler
func (w *watcher) GetEventHandler() ResourceEventHandler {
return w.handler
}

// Store returns the store object for the resource that is being watched
func (w *watcher) Store() cache.Store {
return w.store
Expand Down

0 comments on commit 4d25383

Please sign in to comment.