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

Function GetMetadataOptions

fs/metadata.go:155–172  ·  view source on GitHub ↗

GetMetadataOptions from an DirEntry and merge it with any in options If --metadata isn't in use it will return nil. If the object has no metadata then metadata will be nil. This should be passed the destination Fs for the metadata mapper

(ctx context.Context, dstFs Fs, o DirEntry, options []OpenOption)

Source from the content-addressed store, hash-verified

153//
154// This should be passed the destination Fs for the metadata mapper
155func GetMetadataOptions(ctx context.Context, dstFs Fs, o DirEntry, options []OpenOption) (metadata Metadata, err error) {
156 ci := GetConfig(ctx)
157 if !ci.Metadata {
158 return nil, nil
159 }
160 metadata, err = GetMetadata(ctx, o)
161 if err != nil {
162 return nil, err
163 }
164 metadata.MergeOptions(options)
165 if len(ci.MetadataMapper) != 0 {
166 metadata, err = metadataMapper(ctx, ci.MetadataMapper, dstFs, o, metadata)
167 if err != nil {
168 return nil, err
169 }
170 }
171 return metadata, nil
172}

Callers 15

getModTimeMethod · 0.92
CopyMethod · 0.92
MoveMethod · 0.92
UpdateMethod · 0.92
prepareUploadMethod · 0.92
CopyMethod · 0.92
MoveMethod · 0.92
UpdateMethod · 0.92
assembleCopyParamsFunction · 0.92
applyMappedMetadataMethod · 0.92

Calls 4

GetMetadataFunction · 0.85
metadataMapperFunction · 0.85
MergeOptionsMethod · 0.80
GetConfigFunction · 0.70

Tested by 1

TestMetadataMapperFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…