(ctx context.Context)
| 72 | } |
| 73 | |
| 74 | func (c *RedisClient) Ping(ctx context.Context) error { |
| 75 | var cancel context.CancelFunc |
| 76 | if c.timeout > 0 { |
| 77 | ctx, cancel = context.WithTimeout(ctx, c.timeout) |
| 78 | defer cancel() |
| 79 | } |
| 80 | |
| 81 | pong, err := c.rdb.Ping(ctx).Result() |
| 82 | if err != nil { |
| 83 | return err |
| 84 | } |
| 85 | if pong != "PONG" { |
| 86 | return fmt.Errorf("redis: Unexpected PING response %q", pong) |
| 87 | } |
| 88 | return nil |
| 89 | } |
| 90 | |
| 91 | func (c *RedisClient) MSet(ctx context.Context, keys []string, values [][]byte) error { |
| 92 | var cancel context.CancelFunc |
no outgoing calls
no test coverage detected