MCPcopy Create free account
hub / github.com/AbelChe/evil_minio / Stat

Method Stat

cmd/disk-cache-backend.go:483–504  ·  view source on GitHub ↗

Stat returns ObjectInfo from disk cache

(ctx context.Context, bucket, object string)

Source from the content-addressed store, hash-verified

481
482// Stat returns ObjectInfo from disk cache
483func (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.

Callers

nothing calls this directly

Calls 4

statCachedMetaMethod · 0.95
ToObjectInfoMethod · 0.95
getCacheSHADirFunction · 0.85
decryptCacheObjectETagFunction · 0.85

Tested by

no test coverage detected