codemp-vscode/proto/buffer.proto

42 lines
821 B
Protocol Buffer
Raw Normal View History

syntax = "proto3";
package buffer;
service Buffer {
rpc Attach (BufferPayload) returns (stream RawOp);
rpc Edit (OperationRequest) returns (BufferResponse);
rpc Create (BufferPayload) returns (BufferResponse);
2023-04-11 22:35:10 +02:00
rpc Sync (BufferPayload) returns (BufferResponse);
2023-04-12 03:29:42 +02:00
rpc Cursor (CursorMov) returns (BufferResponse);
rpc Listen (BufferPayload) returns (stream CursorMov);
}
message RawOp {
string opseq = 1;
string user = 2;
}
2023-04-12 03:29:42 +02:00
message CursorMov {
string user = 1;
string path = 2;
int64 row = 3;
int64 col = 4;
}
message OperationRequest {
string path = 1;
string hash = 2;
string opseq = 3;
string user = 4;
}
message BufferPayload {
string path = 1;
string user = 2;
optional string content = 3;
}
message BufferResponse {
bool accepted = 1;
2023-04-11 22:35:10 +02:00
optional string content = 2;
}