SetContext set value to cache
(ctx context.Context, cache Cache, key string, val interface{}, timeout time.Duration)
| 32 | |
| 33 | // SetContext set value to cache |
| 34 | func SetContext(ctx context.Context, cache Cache, key string, val interface{}, timeout time.Duration) error { |
| 35 | if cache, ok := cache.(ContextCache); ok { |
| 36 | return cache.SetContext(ctx, key, val, timeout) |
| 37 | } |
| 38 | return cache.Set(key, val, timeout) |
| 39 | } |
| 40 | |
| 41 | // IsExistContext check value exists in cache. |
| 42 | func IsExistContext(ctx context.Context, cache Cache, key string) bool { |
no test coverage detected
searching dependent graphs…