-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Change watching events to use interface instead of struct #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ import ( | |
| // EventHandler accepts a workqueue and returns ResourceEventHandlerFuncs that enqueue messages to it | ||
| // for add / update / delete events | ||
| type EventHandler interface { | ||
| Get(r workqueue.RateLimitingInterface) cache.ResourceEventHandlerFuncs | ||
| Get(r workqueue.RateLimitingInterface) cache.ResourceEventHandler | ||
| } | ||
|
|
||
| // MapAndEnqueue provides Fns to map objects to name/namespace keys and enqueue them as messages | ||
|
|
@@ -42,7 +42,7 @@ type MapAndEnqueue struct { | |
| } | ||
|
|
||
| // Get returns ResourceEventHandlerFuncs that Map an object to a Key and enqueue the key if it is non-empty | ||
|
||
| func (mp MapAndEnqueue) Get(r workqueue.RateLimitingInterface) cache.ResourceEventHandlerFuncs { | ||
| func (mp MapAndEnqueue) Get(r workqueue.RateLimitingInterface) cache.ResourceEventHandler { | ||
| // Enqueue the mapped key for updates to the object | ||
| return cache.ResourceEventHandlerFuncs{ | ||
| AddFunc: func(obj interface{}) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,7 @@ import ( | |
| type ReconcileFn func(ReconcileKey) error | ||
|
|
||
| // HandleFnProvider returns cache.ResourceEventHandlerFuncs that may enqueue messages | ||
|
||
| type HandleFnProvider func(workqueue.RateLimitingInterface) cache.ResourceEventHandlerFuncs | ||
| type HandleFnProvider func(workqueue.RateLimitingInterface) cache.ResourceEventHandler | ||
|
|
||
| // ReconcileKey provides a lookup key for a Kubernetes object. | ||
| type ReconcileKey struct { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change
ResourceEventHandlerFuncsin the comment?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done