Fetch implements Cache.
(ctx context.Context, keys []string)
| 179 | |
| 180 | // Fetch implements Cache. |
| 181 | func (c *FifoCache) Fetch(ctx context.Context, keys []string) (found []string, bufs [][]byte, missing []string) { |
| 182 | found, missing, bufs = make([]string, 0, len(keys)), make([]string, 0, len(keys)), make([][]byte, 0, len(keys)) |
| 183 | for _, key := range keys { |
| 184 | val, ok := c.Get(ctx, key) |
| 185 | if !ok { |
| 186 | missing = append(missing, key) |
| 187 | continue |
| 188 | } |
| 189 | |
| 190 | found = append(found, key) |
| 191 | bufs = append(bufs, val) |
| 192 | } |
| 193 | return |
| 194 | } |
| 195 | |
| 196 | // Store implements Cache. |
| 197 | func (c *FifoCache) Store(ctx context.Context, keys []string, values [][]byte) { |