92 lines
1.9 KiB
Protocol Buffer
92 lines
1.9 KiB
Protocol Buffer
syntax = "proto3";
|
|
package anytype;
|
|
option go_package = "/syncproto";
|
|
|
|
import "pkg/acl/aclchanges/aclpb/protos/aclchanges.proto";
|
|
|
|
message Message {
|
|
Header header = 1;
|
|
bytes data = 2;
|
|
}
|
|
|
|
message Header {
|
|
bytes traceId = 1;
|
|
uint64 requestId = 2;
|
|
uint64 replyId = 3;
|
|
MessageType type = 4;
|
|
string debugInfo = 5;
|
|
}
|
|
|
|
enum MessageType {
|
|
MessageTypeSystem = 0;
|
|
MessageTypeSpace = 1;
|
|
MessageTypeSync = 2;
|
|
MessageTypeFile = 3;
|
|
}
|
|
|
|
message System {
|
|
Handshake handshake = 1;
|
|
Ping ping = 2;
|
|
Ack ack = 3;
|
|
|
|
message Handshake {
|
|
string protocolVersion = 1;
|
|
}
|
|
message Ping {
|
|
uint64 unixTime = 1;
|
|
}
|
|
message Ack {
|
|
Error error = 2;
|
|
}
|
|
message Error {
|
|
Code code = 1;
|
|
string description = 2;
|
|
|
|
enum Code {
|
|
UNKNOWN = 0;
|
|
UNSUPPORTED_PROTOCOL_VERSION = 10;
|
|
}
|
|
}
|
|
}
|
|
|
|
message Sync {
|
|
string spaceId = 1;
|
|
ContentValue message = 2;
|
|
acl.Header treeHeader = 3;
|
|
string treeId = 4;
|
|
|
|
message ContentValue {
|
|
oneof value {
|
|
HeadUpdate headUpdate = 1;
|
|
Full.Request fullSyncRequest = 2;
|
|
Full.Response fullSyncResponse = 3;
|
|
ACLList aclList = 4;
|
|
}
|
|
}
|
|
|
|
message ACLList {
|
|
repeated acl.RawRecord records = 1;
|
|
}
|
|
|
|
message HeadUpdate {
|
|
repeated string heads = 1;
|
|
repeated acl.RawChange changes = 2;
|
|
repeated string snapshotPath = 3;
|
|
}
|
|
|
|
message Full {
|
|
// here with send the request with all changes we have (we already know sender's snapshot path)
|
|
message Request {
|
|
repeated string heads = 1;
|
|
repeated acl.RawChange changes = 2;
|
|
repeated string snapshotPath = 3;
|
|
}
|
|
|
|
message Response {
|
|
repeated string heads = 1;
|
|
repeated acl.RawChange changes = 2;
|
|
repeated string snapshotPath = 3;
|
|
}
|
|
}
|
|
}
|