(ctx context.Context, key string)
| 28 | } |
| 29 | |
| 30 | func (r *RedisCache) Get(ctx context.Context, key string) ([]byte, error) { |
| 31 | res, err := r.r.Get(ctx, r.pfx+key).Bytes() |
| 32 | if err != nil { |
| 33 | if err == redis.Nil { |
| 34 | return nil, autocert.ErrCacheMiss |
| 35 | } |
| 36 | return nil, err |
| 37 | } |
| 38 | return res, nil |
| 39 | } |
| 40 | |
| 41 | func (r *RedisCache) Put(ctx context.Context, key string, data []byte) error { |
| 42 | return r.r.Set(ctx, r.pfx+key, data, 0).Err() |
no outgoing calls
no test coverage detected