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

Method GetByKey

tools/cache/delta_fifo.go:380–390  ·  view source on GitHub ↗

GetByKey returns the complete list of deltas for the requested item, setting exists=false if that list is empty. You should treat the items returned inside the deltas as immutable.

(key string)

Source from the content-addressed store, hash-verified

378// setting exists=false if that list is empty.
379// You should treat the items returned inside the deltas as immutable.
380func (f *DeltaFIFO) GetByKey(key string) (item interface{}, exists bool, err error) {
381 f.lock.RLock()
382 defer f.lock.RUnlock()
383 d, exists := f.items[key]
384 if exists {
385 // Copy item's slice so operations on this slice
386 // won't interfere with the object we return.
387 d = copyDeltas(d)
388 }
389 return d, exists, nil
390}
391
392// Checks if the queue is closed
393func (f *DeltaFIFO) IsClosed() bool {

Callers 2

GetMethod · 0.95

Calls 1

copyDeltasFunction · 0.85

Tested by 1