MCPcopy Create free account
hub / github.com/pydio/cells / walkToJSON

Method walkToJSON

common/sync/task/sync.go:346–359  ·  view source on GitHub ↗
(ctx context.Context, source model.PathSyncSource, jsonFile string)

Source from the content-addressed store, hash-verified

344}
345
346func (s *Sync) walkToJSON(ctx context.Context, source model.PathSyncSource, jsonFile string) error {
347
348 db := memory.NewMemDB()
349 if er := source.Walk(ctx, func(path string, node tree.N, err error) error {
350
351 return db.CreateNode(ctx, node, false)
352
353 }, "/", true); er != nil {
354 return er
355 }
356
357 return db.ToJSON(jsonFile)
358
359}
360
361func (s *Sync) statRoots(ctx context.Context, source model.Endpoint) (stat *model.EndpointRootStat, e error) {
362 stat = &model.EndpointRootStat{}

Callers 1

CaptureMethod · 0.95

Calls 4

CreateNodeMethod · 0.95
ToJSONMethod · 0.95
NewMemDBFunction · 0.92
WalkMethod · 0.65

Tested by

no test coverage detected