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

Function NewIndexer

tools/cache/store.go:239–244  ·  view source on GitHub ↗

NewIndexer returns an Indexer implemented simply with a map and a lock.

(keyFunc KeyFunc, indexers Indexers)

Source from the content-addressed store, hash-verified

237
238// NewIndexer returns an Indexer implemented simply with a map and a lock.
239func NewIndexer(keyFunc KeyFunc, indexers Indexers) Indexer {
240 return &cache{
241 cacheStorage: NewThreadSafeStore(indexers, Indices{}),
242 keyFunc: keyFunc,
243 }
244}

Callers 11

TestDaemonSetListerFunction · 0.92
TestNamespaceGetMethodFunction · 0.92
TestNamespaceListMethodFunction · 0.92
TestListerGetMethodFunction · 0.92
TestListerListMethodFunction · 0.92
TestIndexFunction · 0.85
NewIndexerInformerFunction · 0.85
TestGetIndexFuncValuesFunction · 0.85
TestMultiIndexKeysFunction · 0.85
NewSharedIndexInformerFunction · 0.85

Calls 1

NewThreadSafeStoreFunction · 0.85

Tested by 8

TestDaemonSetListerFunction · 0.74
TestNamespaceGetMethodFunction · 0.74
TestNamespaceListMethodFunction · 0.74
TestListerGetMethodFunction · 0.74
TestListerListMethodFunction · 0.74
TestIndexFunction · 0.68
TestGetIndexFuncValuesFunction · 0.68
TestMultiIndexKeysFunction · 0.68