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

Function NewInformer

tools/cache/controller.go:279–289  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

277// * h is the object you want notifications sent to.
278//
279func 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

Callers 3

ExampleNewInformerFunction · 0.85
TestHammerControllerFunction · 0.85
TestUpdateFunction · 0.85

Calls 2

NewStoreFunction · 0.85
newInformerFunction · 0.85

Tested by 3

ExampleNewInformerFunction · 0.68
TestHammerControllerFunction · 0.68
TestUpdateFunction · 0.68