MCPcopy Create free account
hub / github.com/rclone/rclone / applyGetObjectOptions

Method applyGetObjectOptions

backend/oracleobjectstorage/object.go:456–492  ·  view source on GitHub ↗
(req *objectstorage.GetObjectRequest, options ...fs.OpenOption)

Source from the content-addressed store, hash-verified

454}
455
456func (o *Object) applyGetObjectOptions(req *objectstorage.GetObjectRequest, options ...fs.OpenOption) {
457 fs.FixRangeOption(options, o.bytes)
458 for _, option := range options {
459 switch option.(type) {
460 case *fs.RangeOption, *fs.SeekOption:
461 _, value := option.Header()
462 req.Range = &value
463 default:
464 if option.Mandatory() {
465 fs.Logf(o, "Unsupported mandatory option: %v", option)
466 }
467 }
468 }
469 // Apply upload options
470 for _, option := range options {
471 key, value := option.Header()
472 lowerKey := strings.ToLower(key)
473 switch lowerKey {
474 case "":
475 // ignore
476 case "cache-control":
477 req.HttpResponseCacheControl = common.String(value)
478 case "content-disposition":
479 req.HttpResponseContentDisposition = common.String(value)
480 case "content-encoding":
481 req.HttpResponseContentEncoding = common.String(value)
482 case "content-language":
483 req.HttpResponseContentLanguage = common.String(value)
484 case "content-type":
485 req.HttpResponseContentType = common.String(value)
486 case "range":
487 // do nothing
488 default:
489 fs.Errorf(o, "Don't know how to set key %q on upload", key)
490 }
491 }
492}
493
494func (o *Object) applyMultipartUploadOptions(putReq *objectstorage.PutObjectRequest, req *objectstorage.CreateMultipartUploadRequest) {
495 req.ContentType = putReq.ContentType

Callers 1

OpenMethod · 0.95

Calls 6

FixRangeOptionFunction · 0.92
LogfFunction · 0.92
ErrorfFunction · 0.92
HeaderMethod · 0.65
MandatoryMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected