MCPcopy
hub / github.com/minio/minio-go / Stat

Method Stat

api-get-object.go:431–457  ·  view source on GitHub ↗

Stat returns the ObjectInfo structure describing Object.

()

Source from the content-addressed store, hash-verified

429
430// Stat returns the ObjectInfo structure describing Object.
431func (o *Object) Stat() (ObjectInfo, error) {
432 if o == nil {
433 return ObjectInfo{}, errInvalidArgument("Object is nil")
434 }
435 // Locking.
436 o.mutex.Lock()
437 defer o.mutex.Unlock()
438
439 if o.prevErr != nil && o.prevErr != io.EOF || o.isClosed {
440 return ObjectInfo{}, o.prevErr
441 }
442
443 // This is the first request.
444 if !o.isStarted || !o.objectInfoSet {
445 // Send the request and get the response.
446 _, err := o.doGetRequest(getRequest{
447 isFirstReq: !o.isStarted,
448 settingObjectInfo: !o.objectInfoSet,
449 })
450 if err != nil {
451 o.prevErr = err
452 return ObjectInfo{}, err
453 }
454 }
455
456 return o.objectInfo, nil
457}
458
459// ReadAt reads len(b) bytes from the File starting at byte offset
460// off. It returns the number of bytes read and the error, if any.

Callers 15

FGetObjectMethod · 0.80
TestCoreCopyObjectFunction · 0.80
TestCorePutObjectFunction · 0.80
testPutObjectReadAtFunction · 0.80
testTrailingChecksumsFunction · 0.80
testGetObjectSeekEndFunction · 0.80

Calls 2

doGetRequestMethod · 0.95
errInvalidArgumentFunction · 0.85

Tested by 2

TestCoreCopyObjectFunction · 0.64
TestCorePutObjectFunction · 0.64