♻️ Refactor synchronization service

This commit is contained in:
2026-03-30 00:03:23 +08:00
parent 34c8f2a185
commit 4c5fff5390
42 changed files with 4377 additions and 3199 deletions

View File

@@ -0,0 +1,19 @@
package merge
import (
"context"
"voidraft/internal/syncer/snapshot"
)
// Report 描述一次合并中的统计信息。
type Report struct {
Added int
Updated int
Deleted int
Conflicts int
}
// Merger 描述快照合并策略。
type Merger interface {
Merge(ctx context.Context, local *snapshot.Snapshot, remote *snapshot.Snapshot) (*snapshot.Snapshot, Report, error)
}