MCPcopy
hub / github.com/SpecterOps/BloodHound / get

Function get

packages/go/cache/cache.go:56–64  ·  view source on GitHub ↗
(cache *lru.Cache, key string, value any)

Source from the content-addressed store, hash-verified

54}
55
56func get(cache *lru.Cache, key string, value any) (bool, error) {
57 if cachedJSON, ok := cache.Get(key); !ok {
58 return false, nil
59 } else if err := json.Unmarshal(cachedJSON.([]byte), &value); err != nil {
60 return false, fmt.Errorf("error unmarshalling cached entry: %w", err)
61 } else {
62 return true, nil
63 }
64}
65
66func set(cache *lru.Cache, key string, value any) (int, bool, error) {
67 if cachedJSON, err := json.Marshal(value); err != nil {

Callers 2

GetMethod · 0.85
GuardedSetMethod · 0.85

Calls 2

ErrorfMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected