SetCacheWithNotFound set value for notfound
(ctx context.Context, key string)
| 193 | |
| 194 | // SetCacheWithNotFound set value for notfound |
| 195 | func (c *redisCache) SetCacheWithNotFound(ctx context.Context, key string) error { |
| 196 | cacheKey, err := BuildCacheKey(c.KeyPrefix, key) |
| 197 | if err != nil { |
| 198 | return fmt.Errorf("BuildCacheKey error: %v, key=%s", err, key) |
| 199 | } |
| 200 | |
| 201 | return c.client.Set(ctx, cacheKey, NotFoundPlaceholder, DefaultNotFoundExpireTime).Err() |
| 202 | } |
| 203 | |
| 204 | // BuildCacheKey construct a cache key with a prefix |
| 205 | func BuildCacheKey(keyPrefix string, key string) (string, error) { |
nothing calls this directly
no test coverage detected