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

Method ObjectStore

object.go:304–318  ·  view source on GitHub ↗

ObjectStore will look up and bind to an existing object store instance.

(bucket string)

Source from the content-addressed store, hash-verified

302
303// ObjectStore will look up and bind to an existing object store instance.
304func (js *js) ObjectStore(bucket string) (ObjectStore, error) {
305 if !validBucketRe.MatchString(bucket) {
306 return nil, ErrInvalidStoreName
307 }
308 if !js.nc.serverMinVersion(2, 6, 2) {
309 return nil, ErrNeeds262
310 }
311
312 stream := fmt.Sprintf(objNameTmpl, bucket)
313 si, err := js.StreamInfo(stream)
314 if err != nil {
315 return nil, err
316 }
317 return &obs{name: bucket, stream: si.Config.Name, js: js}, nil
318}
319
320// DeleteObjectStore will delete the underlying stream for the named object.
321func (js *js) DeleteObjectStore(bucket string) error {

Callers

nothing calls this directly

Calls 2

StreamInfoMethod · 0.95
serverMinVersionMethod · 0.80

Tested by

no test coverage detected