(ctx context.Context, cfg ObjectStoreConfig)
| 512 | } |
| 513 | |
| 514 | func (js *jetStream) UpdateObjectStore(ctx context.Context, cfg ObjectStoreConfig) (ObjectStore, error) { |
| 515 | scfg, err := js.prepareObjectStoreConfig(cfg) |
| 516 | if err != nil { |
| 517 | return nil, err |
| 518 | } |
| 519 | |
| 520 | // Attempt to update the stream. |
| 521 | stream, err := js.UpdateStream(ctx, scfg) |
| 522 | if err != nil { |
| 523 | if errors.Is(err, ErrStreamNotFound) { |
| 524 | return nil, fmt.Errorf("%w: %s", ErrBucketNotFound, cfg.Bucket) |
| 525 | } |
| 526 | return nil, err |
| 527 | } |
| 528 | pushJS, err := js.legacyJetStream() |
| 529 | if err != nil { |
| 530 | return nil, err |
| 531 | } |
| 532 | |
| 533 | return mapStreamToObjectStore(js, pushJS, cfg.Bucket, stream), nil |
| 534 | } |
| 535 | |
| 536 | func (js *jetStream) CreateOrUpdateObjectStore(ctx context.Context, cfg ObjectStoreConfig) (ObjectStore, error) { |
| 537 | scfg, err := js.prepareObjectStoreConfig(cfg) |
nothing calls this directly
no test coverage detected