syntax = "proto3"; package anySpace; option go_package = "common/commonspace/spacesyncproto"; import "pkg/acl/treechangeproto/protos/treechange.proto"; import "pkg/acl/aclrecordproto/protos/aclrecord.proto"; enum ErrCodes { Unexpected = 0; } service Space { // HeadSync compares all objects and their hashes in a space rpc HeadSync(HeadSyncRequest) returns (HeadSyncResponse); // PushSpace sends new space to the node rpc PushSpace(PushSpaceRequest) returns (PushSpaceResponse); // Stream opens object sync stream with node or client 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; treechange.RawTreeChangeWithId rootChange = 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 treechange.RawTreeChangeWithId changes = 2; repeated string snapshotPath = 3; } // ObjectHeadUpdate is a message sent when document needs full sync message ObjectFullSyncRequest { repeated string heads = 1; repeated treechange.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 treechange.RawTreeChangeWithId changes = 2; repeated string snapshotPath = 3; } // ObjectErrorResponse is an error sent as a response for a full sync request message ObjectErrorResponse { string error = 1; } // PushSpaceRequest is a request to add space on a node containing only one acl record message PushSpaceRequest { string spaceId = 1; SpaceHeader spaceHeader = 2; aclrecord.RawACLRecordWithId aclRoot = 3; } // PushSpaceResponse is an empty response message PushSpaceResponse {} // SpaceHeader is a header for a space message SpaceHeader { bytes identity = 1; int64 timestamp = 2; string spaceType = 3; uint64 replicationKey = 4; bytes seed = 5; }