MCPcopy
hub / github.com/rclone/rclone / DstLsf

Function DstLsf

fs/sync/sync_test.go:3020–3054  ·  view source on GitHub ↗
(ctx context.Context, Fremote fs.Fs)

Source from the content-addressed store, hash-verified

3018}
3019
3020func DstLsf(ctx context.Context, Fremote fs.Fs) *bytes.Buffer {
3021 opt := operations.ListJSONOpt{
3022 NoModTime: false,
3023 NoMimeType: true,
3024 DirsOnly: false,
3025 FilesOnly: true,
3026 Recurse: true,
3027 ShowHash: true,
3028 HashTypes: []string{"MD5"},
3029 }
3030
3031 var list operations.ListFormat
3032
3033 list.SetSeparator(";")
3034 timeFormat := operations.FormatForLSFPrecision(Fremote.Precision())
3035 if Fremote.Precision() == fs.ModTimeNotSupported {
3036 timeFormat = "none"
3037 }
3038 list.AddModTime(timeFormat)
3039 list.AddHash(hash.MD5)
3040 list.AddSize()
3041 list.AddPath()
3042
3043 out := new(bytes.Buffer)
3044
3045 err := operations.ListJSON(ctx, Fremote, "", &opt, func(item *operations.ListJSONItem) error {
3046 _, _ = fmt.Fprintln(out, list.Format(item))
3047 return nil
3048 })
3049 if err != nil {
3050 fs.Errorf(Fremote, "ListJSON error: %v", err)
3051 }
3052
3053 return out
3054}
3055
3056func LoggerMatchesLsf(logger, lsf *bytes.Buffer) error {
3057 loggerSplit := bytes.Split(logger.Bytes(), []byte("\n"))

Callers 1

testLoggerVsLsfFunction · 0.85

Calls 10

SetSeparatorMethod · 0.95
AddModTimeMethod · 0.95
AddHashMethod · 0.95
AddSizeMethod · 0.95
AddPathMethod · 0.95
FormatMethod · 0.95
FormatForLSFPrecisionFunction · 0.92
ListJSONFunction · 0.92
ErrorfFunction · 0.92
PrecisionMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…