MCPcopy Index your code
hub / github.com/dnote/dnote / getSyncList

Function getSyncList

pkg/cli/cmd/sync/sync.go:148–160  ·  view source on GitHub ↗

getSyncList gets a list of all sync fragments after the specified usn and aggregates them into a syncList data structure

(ctx context.DnoteCtx, afterUSN int)

Source from the content-addressed store, hash-verified

146// getSyncList gets a list of all sync fragments after the specified usn
147// and aggregates them into a syncList data structure
148func getSyncList(ctx context.DnoteCtx, afterUSN int) (syncList, error) {
149 fragments, err := getSyncFragments(ctx, afterUSN)
150 if err != nil {
151 return syncList{}, errors.Wrap(err, "getting sync fragments")
152 }
153
154 ret, err := processFragments(fragments)
155 if err != nil {
156 return syncList{}, errors.Wrap(err, "making sync list")
157 }
158
159 return ret, nil
160}
161
162// getSyncFragments repeatedly gets all sync fragments after the specified usn until there is no more new data
163// remaining and returns the buffered list

Callers 2

fullSyncFunction · 0.85
stepSyncFunction · 0.85

Calls 2

getSyncFragmentsFunction · 0.85
processFragmentsFunction · 0.85

Tested by

no test coverage detected