(ctx context.Context)
| 82 | } |
| 83 | |
| 84 | func (c *RedisClient) Ping(ctx context.Context) error { |
| 85 | var cancel context.CancelFunc |
| 86 | if c.timeout > 0 { |
| 87 | ctx, cancel = context.WithTimeout(ctx, c.timeout) |
| 88 | defer cancel() |
| 89 | } |
| 90 | |
| 91 | pong, err := c.rdb.Ping(ctx).Result() |
| 92 | if err != nil { |
| 93 | return err |
| 94 | } |
| 95 | if pong != "PONG" { |
| 96 | return fmt.Errorf("redis: Unexpected PING response %q", pong) |
| 97 | } |
| 98 | return nil |
| 99 | } |
| 100 | |
| 101 | func (c *RedisClient) MSet(ctx context.Context, keys []string, values [][]byte) error { |
| 102 | var cancel context.CancelFunc |
no test coverage detected