(ctx context.Context, objectInfo storage.ObjectInfo)
| 460 | func (*moduleReadBucket) isModuleReadBucket() {} |
| 461 | |
| 462 | func (b *moduleReadBucket) getFileInfo(ctx context.Context, objectInfo storage.ObjectInfo) (FileInfo, error) { |
| 463 | return b.pathToFileInfoCache.GetOrAdd( |
| 464 | // We know that storage.ObjectInfo will always have the same values for the same |
| 465 | // ObjectInfo returned from a common bucket, this is documented. Therefore, we |
| 466 | // can cache based on just the path. |
| 467 | objectInfo.Path(), |
| 468 | func() (FileInfo, error) { |
| 469 | return b.getFileInfoUncached(ctx, objectInfo) |
| 470 | }, |
| 471 | ) |
| 472 | } |
| 473 | |
| 474 | func (b *moduleReadBucket) getFileInfoUncached(ctx context.Context, objectInfo storage.ObjectInfo) (FileInfo, error) { |
| 475 | fileType, err := FileTypeForPath(objectInfo.Path()) |
no test coverage detected