MCPcopy
hub / github.com/grafana/dskit / GetMultiWithError

Method GetMultiWithError

cache/mock.go:72–87  ·  view source on GitHub ↗
(_ context.Context, keys []string, _ ...Option)

Source from the content-addressed store, hash-verified

70}
71
72func (m *MockCache) GetMultiWithError(_ context.Context, keys []string, _ ...Option) (map[string][]byte, error) {
73 m.mu.Lock()
74 defer m.mu.Unlock()
75
76 found := make(map[string][]byte, len(keys))
77
78 now := m.now
79 for _, k := range keys {
80 v, ok := m.cache[k]
81 if ok && now.Before(v.ExpiresAt) {
82 found[k] = v.Data
83 }
84 }
85
86 return found, nil
87}
88
89func (m *MockCache) GetItems() map[string]Item {
90 m.mu.Lock()

Callers 1

GetMultiMethod · 0.95

Calls 1

BeforeMethod · 0.65

Tested by

no test coverage detected