(ctx context.Context, cfg ObjectStoreConfig)
| 489 | ) |
| 490 | |
| 491 | func (js *jetStream) CreateObjectStore(ctx context.Context, cfg ObjectStoreConfig) (ObjectStore, error) { |
| 492 | scfg, err := js.prepareObjectStoreConfig(cfg) |
| 493 | if err != nil { |
| 494 | return nil, err |
| 495 | } |
| 496 | |
| 497 | stream, err := js.CreateStream(ctx, scfg) |
| 498 | if err != nil { |
| 499 | if errors.Is(err, ErrStreamNameAlreadyInUse) { |
| 500 | // errors are joined so that backwards compatibility is retained |
| 501 | // and previous checks for ErrStreamNameAlreadyInUse will still work. |
| 502 | err = errors.Join(fmt.Errorf("%w: %s", ErrBucketExists, cfg.Bucket), err) |
| 503 | } |
| 504 | return nil, err |
| 505 | } |
| 506 | pushJS, err := js.legacyJetStream() |
| 507 | if err != nil { |
| 508 | return nil, err |
| 509 | } |
| 510 | |
| 511 | return mapStreamToObjectStore(js, pushJS, cfg.Bucket, stream), nil |
| 512 | } |
| 513 | |
| 514 | func (js *jetStream) UpdateObjectStore(ctx context.Context, cfg ObjectStoreConfig) (ObjectStore, error) { |
| 515 | scfg, err := js.prepareObjectStoreConfig(cfg) |
nothing calls this directly
no test coverage detected