FilteringResourceEventHandler applies the provided filter to all events coming in, ensuring the appropriate nested handler method is invoked. An object that starts passing the filter after an update is considered an add, and an object that stops passing the filter after an update is considered a del
| 215 | // that starts passing the filter after an update is considered an add, and an |
| 216 | // object that stops passing the filter after an update is considered a delete. |
| 217 | type FilteringResourceEventHandler struct { |
| 218 | FilterFunc func(obj interface{}) bool |
| 219 | Handler ResourceEventHandler |
| 220 | } |
| 221 | |
| 222 | // OnAdd calls the nested handler only if the filter succeeds |
| 223 | func (r FilteringResourceEventHandler) OnAdd(obj interface{}) { |
nothing calls this directly
no outgoing calls
no test coverage detected