(_ context.Context, key string)
| 39 | } |
| 40 | |
| 41 | func (m *memoryCache[T]) Get(_ context.Context, key string) (T, bool, error) { |
| 42 | val, ok := m.lru.Get(key) |
| 43 | m.logger.Debugw("msg", "cache get", "key", key, "hit", ok, "backend", "memory") |
| 44 | return val, ok, nil |
| 45 | } |
| 46 | |
| 47 | func (m *memoryCache[T]) Set(_ context.Context, key string, value T) error { |
| 48 | m.lru.Add(key, value) |