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

Method GetByKey

tools/cache/heap.go:291–299  ·  view source on GitHub ↗

GetByKey returns the requested item, or sets exists=false.

(key string)

Source from the content-addressed store, hash-verified

289
290// GetByKey returns the requested item, or sets exists=false.
291func (h *Heap) GetByKey(key string) (interface{}, bool, error) {
292 h.lock.RLock()
293 defer h.lock.RUnlock()
294 item, exists := h.data.items[key]
295 if !exists {
296 return nil, false, nil
297 }
298 return item.obj, true, nil
299}
300
301// IsClosed returns true if the queue is closed.
302func (h *Heap) IsClosed() bool {

Callers 2

GetMethod · 0.95
TestHeap_GetByKeyFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestHeap_GetByKeyFunction · 0.76