MCPcopy
hub / github.com/kubernetes/client-go / NewIndexerInformer

Function NewIndexerInformer

tools/cache/controller.go:307–318  ·  view source on GitHub ↗

NewIndexerInformer returns a Indexer and a controller for populating the index while also providing event notifications. You should only used the returned Index for Get/List operations; Add/Modify/Deletes will cause the event notifications to be faulty. Parameters: * lw is list and watch functions

(
	lw ListerWatcher,
	objType runtime.Object,
	resyncPeriod time.Duration,
	h ResourceEventHandler,
	indexers Indexers,
)

Source from the content-addressed store, hash-verified

305// * indexers is the indexer for the received object type.
306//
307func NewIndexerInformer(
308 lw ListerWatcher,
309 objType runtime.Object,
310 resyncPeriod time.Duration,
311 h ResourceEventHandler,
312 indexers Indexers,
313) (Indexer, Controller) {
314 // This will hold the client state, as we know it.
315 clientState := NewIndexer(DeletionHandlingMetaNamespaceKeyFunc, indexers)
316
317 return clientState, newInformer(lw, objType, resyncPeriod, h, clientState)
318}
319
320// newInformer returns a controller for populating the store while also
321// providing event notifications.

Callers 2

mainFunction · 0.92

Calls 2

NewIndexerFunction · 0.85
newInformerFunction · 0.85

Tested by

no test coverage detected