MCPcopy
hub / github.com/nats-io/nats.go / CreateOrUpdateObjectStore

Method CreateOrUpdateObjectStore

jetstream/object.go:536–552  ·  view source on GitHub ↗
(ctx context.Context, cfg ObjectStoreConfig)

Source from the content-addressed store, hash-verified

534}
535
536func (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
554func (js *jetStream) prepareObjectStoreConfig(cfg ObjectStoreConfig) (StreamConfig, error) {
555 if !validBucketRe.MatchString(cfg.Bucket) {

Callers

nothing calls this directly

Calls 4

CreateOrUpdateStreamMethod · 0.95
legacyJetStreamMethod · 0.95
mapStreamToObjectStoreFunction · 0.85

Tested by

no test coverage detected