(ctx context.Context, cfg KeyValueConfig)
| 591 | } |
| 592 | |
| 593 | func (js *jetStream) CreateOrUpdateKeyValue(ctx context.Context, cfg KeyValueConfig) (KeyValue, error) { |
| 594 | scfg, err := js.prepareKeyValueConfig(ctx, cfg) |
| 595 | if err != nil { |
| 596 | return nil, err |
| 597 | } |
| 598 | |
| 599 | stream, err := js.CreateOrUpdateStream(ctx, scfg) |
| 600 | if err != nil { |
| 601 | return nil, err |
| 602 | } |
| 603 | pushJS, err := js.legacyJetStream() |
| 604 | if err != nil { |
| 605 | return nil, err |
| 606 | } |
| 607 | |
| 608 | return mapStreamToKVS(js, pushJS, stream), nil |
| 609 | } |
| 610 | |
| 611 | func (js *jetStream) prepareKeyValueConfig(ctx context.Context, cfg KeyValueConfig) (StreamConfig, error) { |
| 612 | if !bucketValid(cfg.Bucket) { |
nothing calls this directly
no test coverage detected