syntax = "proto3"; package anySpace; option go_package = "common/commonspace/spacesyncproto"; import "pkg/acl/aclchanges/aclpb/protos/aclchanges.proto"; enum ErrCodes { Unexpected = 0; } service Space { // HeadSync compares all objects and their hashes in a space rpc HeadSync(HeadSyncRequest) returns (HeadSyncResponse); rpc Stream(stream ObjectSyncMessage) returns (stream ObjectSyncMessage); } // HeadSyncRange presenting a request for one range message HeadSyncRange { uint64 from = 1; uint64 to = 2; uint32 limit = 3; } // HeadSyncResult presenting a response for one range message HeadSyncResult { bytes hash = 1; repeated HeadSyncResultElement elements = 2; uint32 count = 3; } // HeadSyncResultElement presenting state of one object message HeadSyncResultElement { string id = 1; string head = 2; } // HeadSyncRequest is a request for HeadSync message HeadSyncRequest { string spaceId = 1; repeated HeadSyncRange ranges = 2; } // HeadSyncResponse is a response for HeadSync message HeadSyncResponse { repeated HeadSyncResult results = 1; } // ObjectSyncMessage is a message sent on object sync message ObjectSyncMessage { string spaceId = 1; ObjectSyncContentValue content = 2; acl.TreeHeader treeHeader = 3; string treeId = 4; string trackingId = 5; // // string identity = 5; // string peerSignature = 6; } // ObjectSyncContentValue provides different types for object sync message ObjectSyncContentValue { oneof value { ObjectHeadUpdate headUpdate = 1; ObjectFullSyncRequest fullSyncRequest = 2; ObjectFullSyncResponse fullSyncResponse = 3; ObjectErrorResponse errorResponse = 4; } } // ObjectHeadUpdate is a message sent on document head update message ObjectHeadUpdate { repeated string heads = 1; repeated acl.RawTreeChangeWithId changes = 2; repeated string snapshotPath = 3; } // ObjectHeadUpdate is a message sent when document needs full sync message ObjectFullSyncRequest { repeated string heads = 1; repeated acl.RawTreeChangeWithId changes = 2; repeated string snapshotPath = 3; } // ObjectFullSyncResponse is a message sent as a response for a specific full sync message ObjectFullSyncResponse { repeated string heads = 1; repeated acl.RawTreeChangeWithId changes = 2; repeated string snapshotPath = 3; } message ObjectErrorResponse { string error = 1; }