MCPcopy Index your code
hub / github.com/Azure/peerd / Get

Method Get

pkg/cache/syncmap.go:21–26  ·  view source on GitHub ↗

Get retrieves the value associated with the given key from the SyncMap. It returns the value and a boolean indicating whether the key was found.

(key string)

Source from the content-addressed store, hash-verified

19// Get retrieves the value associated with the given key from the SyncMap.
20// It returns the value and a boolean indicating whether the key was found.
21func (sm *SyncMap) Get(key string) (entry interface{}, ok bool) {
22 sm.lock.RLock()
23 defer sm.lock.RUnlock()
24 entry, ok = (*sm.mapObj)[key]
25 return
26}
27
28// Set sets a new entry or updates an existing one.
29// Set adds or updates an entry in the SyncMap with the specified key.

Callers 15

TestSyncMapUpdateFunction · 0.95
BenchmarkSyncMapFunction · 0.95
ExistsMethod · 0.45
GetOrCreateMethod · 0.45
SizeMethod · 0.45
NewRecorderFunction · 0.45
KeyMethod · 0.45
TestSetOutboundHeadersFunction · 0.45
TestFillCorrelationIdFunction · 0.45
IsRequestFromAPeerFunction · 0.45
FillCorrelationIdFunction · 0.45
LoggerFunction · 0.45

Calls

no outgoing calls

Tested by 5

TestSyncMapUpdateFunction · 0.76
BenchmarkSyncMapFunction · 0.76
TestSetOutboundHeadersFunction · 0.36
TestFillCorrelationIdFunction · 0.36
TestResolveWithCacheFunction · 0.36