(key string)
| 47 | } |
| 48 | |
| 49 | func (c *Cache) GetBytes(key string) ([]byte, error) { |
| 50 | ctx, cancel := context.WithTimeout(context.Background(), c.rt) |
| 51 | defer cancel() |
| 52 | |
| 53 | result := c.client.Get(ctx, key) |
| 54 | err := result.Err() |
| 55 | if err != nil { |
| 56 | return nil, err |
| 57 | } |
| 58 | |
| 59 | return result.Bytes() |
| 60 | } |
| 61 | |
| 62 | func (c *Cache) IncrementCounter(keyId string, timeUnit key.TimeUnit, incr int64) error { |
| 63 | ctxTimeout, cancel := context.WithTimeout(context.Background(), c.wt) |