MCPcopy
hub / github.com/grafana/dskit / Set

Method Set

cache/memcached_client.go:353–362  ·  view source on GitHub ↗
(ctx context.Context, key string, value []byte, ttl time.Duration)

Source from the content-addressed store, hash-verified

351}
352
353func (c *MemcachedClient) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error {
354 return c.storeOperation(ctx, key, value, ttl, opSet, func(ctx context.Context, key string, value []byte, ttl time.Duration) error {
355 select {
356 case <-ctx.Done():
357 return ctx.Err()
358 default:
359 return c.setSingleItem(key, value, ttl)
360 }
361 })
362}
363
364func (c *MemcachedClient) setSingleItem(key string, value []byte, ttl time.Duration) error {
365 ttlSeconds, ok := toSeconds(ttl)

Callers

nothing calls this directly

Calls 4

storeOperationMethod · 0.95
setSingleItemMethod · 0.95
DoneMethod · 0.65
ErrMethod · 0.45

Tested by

no test coverage detected