Starting on one-way sync

This commit is contained in:
user
2021-08-11 17:19:57 +02:00
parent f3f3d250b4
commit 247b7854aa
17 changed files with 2065 additions and 55 deletions

43
sync_proto.binc Normal file
View File

@ -0,0 +1,43 @@
type SyncInitRequest {
clientCommit: string = 0;
}
type SyncInitResponse {
remoteCommit: string = 0;
needPull : boolean = 1;
needPush : boolean = 2;
}
type Commit {
id : string = 0;
root : string = 1;
before: string = 2;
merge : string = 3;
date : uint64 = 4;
}
type PullGetLogRequest {
limit: uint32 = 0;
start: string = 1;
}
type PullGetLogResponse {
commits: Commit[] = 0;
}
type PullObjectRequest {
id : string = 0;
type: string = 1;
}
type PullObjectResponse {
found: boolean = 0;
data : bytes = 1;
}
service Sync {
SyncInit(SyncInitRequest): SyncInitResponse;
PullGetLog(PullGetLogRequest): PullGetLogResponse;
PullObject(PullObjectRequest): PullObjectResponse;
}