ObjectStore will look up and bind to an existing object store instance.
(bucket string)
| 302 | |
| 303 | // ObjectStore will look up and bind to an existing object store instance. |
| 304 | func (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. |
| 321 | func (js *js) DeleteObjectStore(bucket string) error { |
nothing calls this directly
no test coverage detected