Method
KVSetNX
(ctx context.Context, key string, value []byte, ttl time.Duration)
Source from the content-addressed store, hash-verified
| 635 | } |
| 636 | |
| 637 | func (c *Client) KVSetNX(ctx context.Context, key string, value []byte, ttl time.Duration) (bool, error) { |
| 638 | opts := KVSetOptions{NX: true} |
| 639 | if ttl > 0 { |
| 640 | opts.EX = ttl |
| 641 | } |
| 642 | return c.KVSet(ctx, key, value, opts) |
| 643 | } |
| 644 | |
| 645 | func (c *Client) KVDel(ctx context.Context, keys ...string) (int64, error) { |
| 646 | if len(keys) == 0 { |
Callers
nothing calls this directly
Tested by
no test coverage detected