(ctx context.Context, targetFolder string)
| 245 | } |
| 246 | |
| 247 | func (s *Sync) Capture(ctx context.Context, targetFolder string) error { |
| 248 | |
| 249 | source, _ := model.AsPathSyncSource(s.Source) |
| 250 | targetAsSource, _ := model.AsPathSyncSource(s.Target) |
| 251 | |
| 252 | if s.Direction == model.DirectionBi && s.snapshotFactory != nil { |
| 253 | |
| 254 | leftSnap, err := s.snapshotFactory.Load(source) |
| 255 | if err != nil { |
| 256 | return err |
| 257 | } |
| 258 | if e := s.walkToJSON(ctx, leftSnap, filepath.Join(targetFolder, "snap-source.json")); e != nil { |
| 259 | return e |
| 260 | } |
| 261 | |
| 262 | rightSnap, err := s.snapshotFactory.Load(targetAsSource) |
| 263 | if err != nil { |
| 264 | return err |
| 265 | } |
| 266 | if e := s.walkToJSON(ctx, rightSnap, filepath.Join(targetFolder, "snap-target.json")); e != nil { |
| 267 | return e |
| 268 | } |
| 269 | |
| 270 | } |
| 271 | |
| 272 | if e := s.walkToJSON(ctx, source, filepath.Join(targetFolder, "source.json")); e != nil { |
| 273 | return e |
| 274 | } |
| 275 | |
| 276 | if e := s.walkToJSON(ctx, targetAsSource, filepath.Join(targetFolder, "target.json")); e != nil { |
| 277 | return e |
| 278 | } |
| 279 | |
| 280 | return nil |
| 281 | |
| 282 | } |
| 283 | |
| 284 | func (s *Sync) RootStats(ctx context.Context, useSnapshots bool) (map[string]*model.EndpointRootStat, error) { |
| 285 |
nothing calls this directly
no test coverage detected