(ctx context.Context, cfg ObjectStoreConfig)
| 534 | } |
| 535 | |
| 536 | func (js *jetStream) CreateOrUpdateObjectStore(ctx context.Context, cfg ObjectStoreConfig) (ObjectStore, error) { |
| 537 | scfg, err := js.prepareObjectStoreConfig(cfg) |
| 538 | if err != nil { |
| 539 | return nil, err |
| 540 | } |
| 541 | |
| 542 | stream, err := js.CreateOrUpdateStream(ctx, scfg) |
| 543 | if err != nil { |
| 544 | return nil, err |
| 545 | } |
| 546 | pushJS, err := js.legacyJetStream() |
| 547 | if err != nil { |
| 548 | return nil, err |
| 549 | } |
| 550 | |
| 551 | return mapStreamToObjectStore(js, pushJS, cfg.Bucket, stream), nil |
| 552 | } |
| 553 | |
| 554 | func (js *jetStream) prepareObjectStoreConfig(cfg ObjectStoreConfig) (StreamConfig, error) { |
| 555 | if !validBucketRe.MatchString(cfg.Bucket) { |
nothing calls this directly
no test coverage detected