2022-07-13 01:56:21 +02:00
|
|
|
syntax = "proto3";
|
2023-08-16 17:08:31 +02:00
|
|
|
|
|
|
|
package codemp.buffer;
|
2022-07-13 01:56:21 +02:00
|
|
|
|
2023-08-20 07:32:08 +02:00
|
|
|
// handle buffer changes, keep in sync users
|
2022-07-13 01:56:21 +02:00
|
|
|
service Buffer {
|
2023-08-20 07:32:08 +02:00
|
|
|
// attach to a buffer and receive operations
|
2023-04-07 03:05:21 +02:00
|
|
|
rpc Attach (BufferPayload) returns (stream RawOp);
|
2023-08-20 07:32:08 +02:00
|
|
|
// send an operation for a specific buffer
|
2023-08-16 17:08:31 +02:00
|
|
|
rpc Edit (OperationRequest) returns (BufferEditResponse);
|
2023-08-20 07:32:08 +02:00
|
|
|
// create a new buffer
|
2023-08-16 17:08:31 +02:00
|
|
|
rpc Create (BufferPayload) returns (BufferCreateResponse);
|
2023-08-20 07:32:08 +02:00
|
|
|
// get contents of buffer
|
2023-04-11 22:35:10 +02:00
|
|
|
rpc Sync (BufferPayload) returns (BufferResponse);
|
2023-04-07 03:05:21 +02:00
|
|
|
}
|
2022-07-13 01:56:21 +02:00
|
|
|
|
2023-08-20 07:32:08 +02:00
|
|
|
// empty request
|
2023-08-16 17:08:31 +02:00
|
|
|
message BufferCreateResponse {}
|
2023-08-20 07:32:08 +02:00
|
|
|
|
|
|
|
// empty request
|
2023-08-16 17:08:31 +02:00
|
|
|
message BufferEditResponse {}
|
2023-07-05 00:09:09 +02:00
|
|
|
|
2023-08-20 07:32:08 +02:00
|
|
|
// raw wire operation sequence event
|
2023-07-05 00:09:09 +02:00
|
|
|
message RawOp {
|
2023-08-20 07:32:08 +02:00
|
|
|
// operation seq serialized to json
|
2023-07-05 00:09:09 +02:00
|
|
|
string opseq = 1;
|
2023-08-20 07:32:08 +02:00
|
|
|
|
|
|
|
// user id that has executed the operation
|
2023-07-05 00:09:09 +02:00
|
|
|
string user = 2;
|
2023-04-12 03:29:42 +02:00
|
|
|
}
|
|
|
|
|
2023-08-20 07:32:08 +02:00
|
|
|
// client buffer operation request
|
2023-04-07 03:05:21 +02:00
|
|
|
message OperationRequest {
|
2023-08-20 07:32:08 +02:00
|
|
|
// buffer path to operate onto
|
2023-04-07 03:05:21 +02:00
|
|
|
string path = 1;
|
2023-08-20 07:32:08 +02:00
|
|
|
|
|
|
|
// buffer hash of source state
|
2023-04-07 03:05:21 +02:00
|
|
|
string hash = 2;
|
2023-08-20 07:32:08 +02:00
|
|
|
|
|
|
|
// raw operation sequence
|
|
|
|
RawOp op = 3;
|
2022-07-13 01:56:21 +02:00
|
|
|
}
|
2022-07-31 13:44:48 +02:00
|
|
|
|
2023-08-20 07:32:08 +02:00
|
|
|
// generic buffer operation request
|
2022-07-31 13:44:48 +02:00
|
|
|
message BufferPayload {
|
2023-08-20 07:32:08 +02:00
|
|
|
// buffer path to operate onto
|
2023-04-10 20:24:11 +02:00
|
|
|
string path = 1;
|
2023-08-20 07:32:08 +02:00
|
|
|
|
|
|
|
// user id that is requesting the operation
|
2023-04-10 20:24:11 +02:00
|
|
|
string user = 2;
|
2023-08-20 07:32:08 +02:00
|
|
|
|
|
|
|
// optional buffer full content for replacing
|
2022-07-31 13:44:48 +02:00
|
|
|
optional string content = 3;
|
|
|
|
}
|
|
|
|
|
2023-08-20 07:32:08 +02:00
|
|
|
// response from server with buffer content
|
2022-07-31 13:44:48 +02:00
|
|
|
message BufferResponse {
|
2023-08-20 07:32:08 +02:00
|
|
|
// current buffer content
|
|
|
|
string content = 1;
|
2022-07-31 13:44:48 +02:00
|
|
|
}
|