codemp/proto/buffer.proto

47 lines
879 B
Protocol Buffer
Raw Permalink 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);
rpc Moved (Cursor) returns (BufferResponse);
rpc Listen (BufferPayload) returns (stream Cursor);
}
message Position {
int32 row = 1;
int32 col = 2;
}
message Cursor {
2023-04-12 03:29:42 +02:00
string user = 1;
string buffer = 2;
Position start = 3;
Position end = 4;
}
message RawOp {
string opseq = 1;
string user = 2;
2023-04-12 03:29:42 +02:00
}
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;
}