Stat returns ObjectInfo from disk cache
(ctx context.Context, bucket, object string)
| 481 | |
| 482 | // Stat returns ObjectInfo from disk cache |
| 483 | func (c *diskCache) Stat(ctx context.Context, bucket, object string) (oi ObjectInfo, numHits int, err error) { |
| 484 | var partial bool |
| 485 | var meta *cacheMeta |
| 486 | |
| 487 | cacheObjPath := getCacheSHADir(c.dir, bucket, object) |
| 488 | // Stat the file to get file size. |
| 489 | meta, partial, numHits, err = c.statCachedMeta(ctx, cacheObjPath) |
| 490 | if err != nil { |
| 491 | return |
| 492 | } |
| 493 | if partial { |
| 494 | return oi, numHits, errFileNotFound |
| 495 | } |
| 496 | oi = meta.ToObjectInfo() |
| 497 | oi.Bucket = bucket |
| 498 | oi.Name = object |
| 499 | |
| 500 | if err = decryptCacheObjectETag(&oi); err != nil { |
| 501 | return |
| 502 | } |
| 503 | return |
| 504 | } |
| 505 | |
| 506 | // statCachedMeta returns metadata from cache - including ranges cached, partial to indicate |
| 507 | // if partial object is cached. |
nothing calls this directly
no test coverage detected