MCPcopy Create free account
hub / github.com/conforma/cli / Get

Method Get

internal/policy/cache/cache.go:50–60  ·  view source on GitHub ↗

Get retrieves the value and error for the given key from the cache. It returns the value and true if found, or an empty string and false otherwise.

(key string)

Source from the content-addressed store, hash-verified

48// Get retrieves the value and error for the given key from the cache.
49// It returns the value and true if found, or an empty string and false otherwise.
50func (c *PolicyCache) Get(key string) (string, bool) {
51 actual, ok := c.Data.Load(key)
52 if !ok {
53 return "", ok
54 }
55 entry, ok := actual.(*cacheEntry)
56 if !ok {
57 return "", ok
58 }
59 return entry.value, ok
60}
61
62// Set manually sets the value for a given key in the cache.
63// It overwrites any existing value and error.

Callers 15

PreProcessPolicyFunction · 0.95
TestGetFunction · 0.95
TestSetFunction · 0.95
TestGet_ConcurrentAccessFunction · 0.95
TestGet_TypeSafetyFunction · 0.95
keyFromKubernetesSecretFunction · 0.80
VerifyImageSignaturesMethod · 0.80
HeadMethod · 0.80
ImageMethod · 0.80

Calls

no outgoing calls

Tested by 15

TestGetFunction · 0.76
TestSetFunction · 0.76
TestGet_ConcurrentAccessFunction · 0.76
TestGet_TypeSafetyFunction · 0.76
EvaluateMethod · 0.64
DownloadMethod · 0.64
TypeMethod · 0.64
RoundTripMethod · 0.64
TestOCIParsedBlobFunction · 0.64
TestOCIBlobFilesFunction · 0.64