Get an item from the redis cache
(ctx context.Context, key string)
| 26 | |
| 27 | // Get an item from the redis cache |
| 28 | func (cache *memoryCache) Get(ctx context.Context, key string) (value string, err error) { |
| 29 | ctx, span := cache.tracer.Start(ctx) |
| 30 | defer span.End() |
| 31 | |
| 32 | response, ok := cache.store.Get(key) |
| 33 | if !ok { |
| 34 | return "", stacktrace.NewError(fmt.Sprintf("no item found in cache with key [%s]", key)) |
| 35 | } |
| 36 | |
| 37 | return response.(string), nil |
| 38 | } |
| 39 | |
| 40 | // Set an item in the redis cache |
| 41 | func (cache *memoryCache) Set(ctx context.Context, key string, value string, ttl time.Duration) error { |