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

Function NewStore

tools/cache/store.go:231–236  ·  tools/cache/store.go::NewStore

NewStore returns a Store implemented simply with a map and a lock.

(keyFunc KeyFunc)

Source from the content-addressed store, hash-verified

229
230// NewStore returns a Store implemented simply with a map and a lock.
231func NewStore(keyFunc KeyFunc) Store {
232 return &cache{
233 cacheStorage: NewThreadSafeStore(Indexers{}, Indices{}),
234 keyFunc: keyFunc,
235 }
236}
237
238// NewIndexer returns an Indexer implemented simply with a map and a lock.
239func NewIndexer(keyFunc KeyFunc, indexers Indexers) Indexer {

Callers 12

TestRunUntilFunction · 0.85
TestReflectorResyncChanFunction · 0.85
TestReflectorStopWatchFunction · 0.85
TestCacheFunction · 0.85
NewInformerFunction · 0.85
NewUndeltaStoreFunction · 0.85
ExampleFunction · 0.85

Calls 1

NewThreadSafeStoreFunction · 0.85

Tested by 10

TestRunUntilFunction · 0.68
TestReflectorResyncChanFunction · 0.68
TestReflectorStopWatchFunction · 0.68
TestCacheFunction · 0.68
ExampleFunction · 0.68