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)
| 153 | // |
| 154 | // This should be passed the destination Fs for the metadata mapper |
| 155 | func 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 | } |
searching dependent graphs…