2024-03-09 18:45:32 +01:00
|
|
|
syntax = "proto2";
|
|
|
|
|
|
|
|
import "common.proto";
|
|
|
|
|
|
|
|
package buffer;
|
|
|
|
|
2024-09-05 00:08:07 +02:00
|
|
|
// Handles buffer changes and keeps users in sync.
|
2024-03-09 18:45:32 +01:00
|
|
|
service Buffer {
|
2024-09-05 00:08:07 +02:00
|
|
|
// Attach to a buffer and receive operations.
|
2024-03-09 19:07:23 +01:00
|
|
|
rpc Attach (stream Operation) returns (stream BufferEvent);
|
2024-03-09 18:45:32 +01:00
|
|
|
}
|
|
|
|
|
2024-09-05 00:08:07 +02:00
|
|
|
// Message representing an operation that has occurred.
|
2024-03-09 18:45:32 +01:00
|
|
|
message Operation {
|
2024-09-05 00:08:07 +02:00
|
|
|
// The data of this operation.
|
2024-03-09 19:07:23 +01:00
|
|
|
required bytes data = 1;
|
2024-03-09 18:45:32 +01:00
|
|
|
}
|
|
|
|
|
2024-09-05 00:08:07 +02:00
|
|
|
// Message representing an event that happened in a buffer.
|
2024-03-09 18:45:32 +01:00
|
|
|
message BufferEvent {
|
2024-09-05 00:08:07 +02:00
|
|
|
// The operation that occurred.
|
2024-03-09 18:45:32 +01:00
|
|
|
required Operation op = 1;
|
2024-09-05 00:08:07 +02:00
|
|
|
// The user that sent this event.
|
2024-03-09 18:45:32 +01:00
|
|
|
required common.Identity user = 2;
|
|
|
|
}
|