MCPcopy Index your code
hub / github.com/rclone/rclone / headObject

Method headObject

backend/oracleobjectstorage/object.go:82–107  ·  view source on GitHub ↗

headObject gets the metadata from the object unconditionally

(ctx context.Context)

Source from the content-addressed store, hash-verified

80
81// headObject gets the metadata from the object unconditionally
82func (o *Object) headObject(ctx context.Context) (info *objectstorage.HeadObjectResponse, err error) {
83 bucketName, objectPath := o.split()
84 req := objectstorage.HeadObjectRequest{
85 NamespaceName: common.String(o.fs.opt.Namespace),
86 BucketName: common.String(bucketName),
87 ObjectName: common.String(objectPath),
88 }
89 useBYOKHeadObject(o.fs, &req)
90 var response objectstorage.HeadObjectResponse
91 err = o.fs.pacer.Call(func() (bool, error) {
92 var err error
93 response, err = o.fs.srv.HeadObject(ctx, req)
94 return shouldRetry(ctx, response.HTTPResponse(), err)
95 })
96 if err != nil {
97 if svcErr, ok := err.(common.ServiceError); ok {
98 if svcErr.GetHTTPStatusCode() == http.StatusNotFound {
99 return nil, fs.ErrorObjectNotFound
100 }
101 }
102 fs.Errorf(o, "Failed to head object: %v", err)
103 return nil, err
104 }
105 o.fs.cache.MarkOK(bucketName)
106 return &response, err
107}
108
109func (o *Object) decodeMetaDataHead(info *objectstorage.HeadObjectResponse) (err error) {
110 return o.setMetaData(

Callers 1

readMetaDataMethod · 0.95

Calls 8

splitMethod · 0.95
ErrorfFunction · 0.92
useBYOKHeadObjectFunction · 0.85
HeadObjectMethod · 0.80
MarkOKMethod · 0.80
shouldRetryFunction · 0.70
StringMethod · 0.65
CallMethod · 0.45

Tested by

no test coverage detected