readObjectInfo reads the definition for an object
(ctx context.Context, bucket, bucketPath string)
| 1285 | |
| 1286 | // readObjectInfo reads the definition for an object |
| 1287 | func (f *Fs) readObjectInfo(ctx context.Context, bucket, bucketPath string) (object *storage.Object, err error) { |
| 1288 | err = f.pacer.Call(func() (bool, error) { |
| 1289 | get := f.svc.Objects.Get(bucket, bucketPath).Context(ctx) |
| 1290 | if f.opt.UserProject != "" { |
| 1291 | get = get.UserProject(f.opt.UserProject) |
| 1292 | } |
| 1293 | object, err = get.Do() |
| 1294 | return shouldRetry(ctx, err) |
| 1295 | }) |
| 1296 | if err != nil { |
| 1297 | if gErr, ok := err.(*googleapi.Error); ok { |
| 1298 | if gErr.Code == http.StatusNotFound { |
| 1299 | return nil, fs.ErrorObjectNotFound |
| 1300 | } |
| 1301 | } |
| 1302 | return nil, err |
| 1303 | } |
| 1304 | return object, nil |
| 1305 | } |
| 1306 | |
| 1307 | // readMetaData gets the metadata if it hasn't already been fetched |
| 1308 | // |
no test coverage detected