(ctx context.Context, key string)
| 662 | } |
| 663 | |
| 664 | func (c *Client) KVTTL(ctx context.Context, key string) (time.Duration, bool, error) { |
| 665 | cmd, errClient := c.commandClient() |
| 666 | if errClient != nil { |
| 667 | return 0, false, errClient |
| 668 | } |
| 669 | ttl, errTTL := cmd.TTL(ctx, key).Result() |
| 670 | if errTTL != nil { |
| 671 | return 0, false, errTTL |
| 672 | } |
| 673 | switch { |
| 674 | case ttl <= -2*time.Second: |
| 675 | return 0, false, nil |
| 676 | case ttl == -1*time.Second: |
| 677 | return 0, true, nil |
| 678 | default: |
| 679 | return ttl, true, nil |
| 680 | } |
| 681 | } |
| 682 | |
| 683 | func (c *Client) KVIncrBy(ctx context.Context, key string, delta int64) (int64, error) { |
| 684 | cmd, errClient := c.commandClient() |
nothing calls this directly
no test coverage detected