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

Method GetByKey

tools/cache/store.go:204–207  ·  view source on GitHub ↗

GetByKey returns the request item, or exists=false. GetByKey is completely threadsafe as long as you treat all items as immutable.

(key string)

Source from the content-addressed store, hash-verified

202// GetByKey returns the request item, or exists=false.
203// GetByKey is completely threadsafe as long as you treat all items as immutable.
204func (c *cache) GetByKey(key string) (item interface{}, exists bool, err error) {
205 item, exists = c.cacheStorage.Get(key)
206 return item, exists, nil
207}
208
209// Replace will delete the contents of 'c', using instead the given list.
210// 'c' takes ownership of the list, you should not reference the list again

Callers 1

GetMethod · 0.95

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected