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

Method KVSetNX

internal/home/client.go:637–643  ·  view source on GitHub ↗
(ctx context.Context, key string, value []byte, ttl time.Duration)

Source from the content-addressed store, hash-verified

635}
636
637func (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
645func (c *Client) KVDel(ctx context.Context, keys ...string) (int64, error) {
646 if len(keys) == 0 {

Callers

nothing calls this directly

Calls 1

KVSetMethod · 0.95

Tested by

no test coverage detected