NewInformer returns a Store and a controller for populating the store while also providing event notifications. You should only used the returned Store for Get/List operations; Add/Modify/Deletes will cause the event notifications to be faulty. Parameters: * lw is list and watch functions for the s
( lw ListerWatcher, objType runtime.Object, resyncPeriod time.Duration, h ResourceEventHandler, )
| 277 | // * h is the object you want notifications sent to. |
| 278 | // |
| 279 | func NewInformer( |
| 280 | lw ListerWatcher, |
| 281 | objType runtime.Object, |
| 282 | resyncPeriod time.Duration, |
| 283 | h ResourceEventHandler, |
| 284 | ) (Store, Controller) { |
| 285 | // This will hold the client state, as we know it. |
| 286 | clientState := NewStore(DeletionHandlingMetaNamespaceKeyFunc) |
| 287 | |
| 288 | return clientState, newInformer(lw, objType, resyncPeriod, h, clientState) |
| 289 | } |
| 290 | |
| 291 | // NewIndexerInformer returns a Indexer and a controller for populating the index |
| 292 | // while also providing event notifications. You should only used the returned |