Method
GetMultiWithError
(_ context.Context, keys []string, _ ...Option)
Source from the content-addressed store, hash-verified
| 70 | } |
| 71 | |
| 72 | func (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 | |
| 89 | func (m *MockCache) GetItems() map[string]Item { |
| 90 | m.mu.Lock() |
Tested by
no test coverage detected