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

Function NewSharedIndexInformer

tools/cache/shared_informer.go:132–145  ·  view source on GitHub ↗

NewSharedIndexInformer creates a new instance for the listwatcher.

(lw ListerWatcher, objType runtime.Object, defaultEventHandlerResyncPeriod time.Duration, indexers Indexers)

Source from the content-addressed store, hash-verified

130
131// NewSharedIndexInformer creates a new instance for the listwatcher.
132func NewSharedIndexInformer(lw ListerWatcher, objType runtime.Object, defaultEventHandlerResyncPeriod time.Duration, indexers Indexers) SharedIndexInformer {
133 realClock := &clock.RealClock{}
134 sharedIndexInformer := &sharedIndexInformer{
135 processor: &sharedProcessor{clock: realClock},
136 indexer: NewIndexer(DeletionHandlingMetaNamespaceKeyFunc, indexers),
137 listerWatcher: lw,
138 objectType: objType,
139 resyncCheckPeriod: defaultEventHandlerResyncPeriod,
140 defaultEventHandlerResyncPeriod: defaultEventHandlerResyncPeriod,
141 cacheMutationDetector: NewCacheMutationDetector(fmt.Sprintf("%T", objType)),
142 clock: realClock,
143 }
144 return sharedIndexInformer
145}
146
147// InformerSynced is a function that can be used to determine if an informer has synced. This is useful for determining if caches have synced.
148type InformerSynced func() bool

Calls 2

NewIndexerFunction · 0.85
NewCacheMutationDetectorFunction · 0.85

Tested by

no test coverage detected