(ctx context.Context, cfg KeyValueConfig)
| 570 | } |
| 571 | |
| 572 | func (js *jetStream) UpdateKeyValue(ctx context.Context, cfg KeyValueConfig) (KeyValue, error) { |
| 573 | scfg, err := js.prepareKeyValueConfig(ctx, cfg) |
| 574 | if err != nil { |
| 575 | return nil, err |
| 576 | } |
| 577 | |
| 578 | stream, err := js.UpdateStream(ctx, scfg) |
| 579 | if err != nil { |
| 580 | if errors.Is(err, ErrStreamNotFound) { |
| 581 | err = fmt.Errorf("%w: %s", ErrBucketNotFound, cfg.Bucket) |
| 582 | } |
| 583 | return nil, err |
| 584 | } |
| 585 | pushJS, err := js.legacyJetStream() |
| 586 | if err != nil { |
| 587 | return nil, err |
| 588 | } |
| 589 | |
| 590 | return mapStreamToKVS(js, pushJS, stream), nil |
| 591 | } |
| 592 | |
| 593 | func (js *jetStream) CreateOrUpdateKeyValue(ctx context.Context, cfg KeyValueConfig) (KeyValue, error) { |
| 594 | scfg, err := js.prepareKeyValueConfig(ctx, cfg) |
nothing calls this directly
no test coverage detected