MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / KVTTL

Method KVTTL

internal/home/client.go:664–681  ·  view source on GitHub ↗
(ctx context.Context, key string)

Source from the content-addressed store, hash-verified

662}
663
664func (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
683func (c *Client) KVIncrBy(ctx context.Context, key string, delta int64) (int64, error) {
684 cmd, errClient := c.commandClient()

Callers

nothing calls this directly

Calls 1

commandClientMethod · 0.95

Tested by

no test coverage detected