MCPcopy
hub / github.com/rclone/rclone / AddMetadata

Method AddMetadata

fs/operations/operations.go:2332–2344  ·  view source on GitHub ↗

AddMetadata adds file's Metadata to the output if known

()

Source from the content-addressed store, hash-verified

2330
2331// AddMetadata adds file's Metadata to the output if known
2332func (l *ListFormat) AddMetadata() {
2333 l.AppendOutput(func(entry *ListJSONItem) string {
2334 metadata := entry.Metadata
2335 if metadata == nil {
2336 metadata = make(fs.Metadata)
2337 }
2338 out, err := json.Marshal(metadata)
2339 if err != nil {
2340 return fmt.Sprintf("Failed to read metadata: %v", err.Error())
2341 }
2342 return string(out)
2343 })
2344}
2345
2346// AppendOutput adds string generated by specific function to printed output
2347func (l *ListFormat) AppendOutput(functionToAppend func(item *ListJSONItem) string) {

Callers 3

LsfFunction · 0.95
TestListFormatFunction · 0.95
SetListFormatMethod · 0.95

Calls 2

AppendOutputMethod · 0.95
ErrorMethod · 0.65

Tested by 1

TestListFormatFunction · 0.76