newTreeDiff instantiates a new TreeDiff - If left is a MetadataProvider and right a MetadataReceiver, it will set up metadata diff management
(left model.PathSyncSource, right model.PathSyncSource)
| 69 | // newTreeDiff instantiates a new TreeDiff - If left is a MetadataProvider and right a MetadataReceiver, |
| 70 | // it will set up metadata diff management |
| 71 | func newTreeDiff(left model.PathSyncSource, right model.PathSyncSource) *TreeDiff { |
| 72 | t := &TreeDiff{ |
| 73 | //ctx: ctx, |
| 74 | left: left, |
| 75 | right: right, |
| 76 | } |
| 77 | mp, leftOk := left.(model.MetadataProvider) |
| 78 | _, rightOk := right.(model.MetadataReceiver) |
| 79 | if leftOk && rightOk { |
| 80 | if globs, o := mp.ProvidesMetadataNamespaces(); o { |
| 81 | t.includeMetas = globs |
| 82 | } |
| 83 | } |
| 84 | return t |
| 85 | } |
| 86 | |
| 87 | // Compute performs the actual diff between left and right |
| 88 | func (diff *TreeDiff) Compute(ctx context.Context, root string, lock chan bool, rootStats map[string]*model.EndpointRootStat, ignores ...glob.Glob) error { |
searching dependent graphs…