MCPcopy Create free account
hub / github.com/zalando/skipper / SetWithExpire

Method SetWithExpire

net/valkey.go:533–544  ·  view source on GitHub ↗
(ctx context.Context, key string, value string, expire time.Duration)

Source from the content-addressed store, hash-verified

531}
532
533func (vrc *ValkeyRingClient) SetWithExpire(ctx context.Context, key string, value string, expire time.Duration) error {
534 results := vrc.ring.SetWithExpire(ctx, key, value, expire)
535 for _, res := range results {
536 if err := res.Error(); err != nil {
537 return err
538 }
539 }
540 if len(results) == 0 {
541 return fmt.Errorf("failed to SetWithExpire, no result")
542 }
543 return results[len(results)-1].Error()
544}
545
546func (vrc *ValkeyRingClient) ZAdd(ctx context.Context, key, val string, score float64) (int64, error) {
547 res := vrc.ring.ZAdd(ctx, key, val, score)

Calls 3

ErrorMethod · 0.65
ErrorfMethod · 0.65
SetWithExpireMethod · 0.45