Method
Set
(_ context.Context, key string, value []byte, ttl time.Duration)
Source from the content-addressed store, hash-verified
| 46 | } |
| 47 | |
| 48 | func (m *MockCache) Set(_ context.Context, key string, value []byte, ttl time.Duration) error { |
| 49 | m.mu.Lock() |
| 50 | defer m.mu.Unlock() |
| 51 | m.cache[key] = Item{Data: value, ExpiresAt: m.now.Add(ttl)} |
| 52 | return nil |
| 53 | } |
| 54 | |
| 55 | func (m *MockCache) Add(_ context.Context, key string, value []byte, ttl time.Duration) error { |
| 56 | m.mu.Lock() |
Callers
nothing calls this directly
Tested by
no test coverage detected