(ctx context.Context, key string)
| 122 | } |
| 123 | |
| 124 | func (c *MemoryCache) GetOnly(ctx context.Context, key string) *Response { |
| 125 | log := logger.FromContext(ctx) |
| 126 | cacheKey := c.keyProvider.CacheKey(ctx, key) |
| 127 | |
| 128 | if value, _ := kvCache.Get(cacheKey); value != nil { |
| 129 | log.Debugw("Memory GetOnly cache hit", "cacheKey", cacheKey) |
| 130 | if response, ok := value.(Response); ok { |
| 131 | return &response |
| 132 | } |
| 133 | |
| 134 | log.Debugw("Memory GetOnly cache type mismatch", "cacheKey", cacheKey) |
| 135 | return nil |
| 136 | } |
| 137 | |
| 138 | log.Debugw("Memory GetOnly cache miss", "cacheKey", cacheKey) |
| 139 | return nil |
| 140 | } |
| 141 | |
| 142 | func NewMemoryCache(cfg config.APIConfig, keyProvider KeyProvider, loader Loader, cacheDuration time.Duration) *MemoryCache { |
| 143 | return &MemoryCache{ |
nothing calls this directly
no test coverage detected