mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 23:34:49 +01:00
44 lines
942 B
Protocol Buffer
44 lines
942 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
package codemp.cursor;
|
|
|
|
// handle cursor events and broadcast to all users
|
|
service Cursor {
|
|
// send cursor movement to server
|
|
rpc Moved (CursorEvent) returns (MovedResponse);
|
|
// attach to a workspace and receive cursor events
|
|
rpc Listen (UserIdentity) returns (stream CursorEvent);
|
|
}
|
|
|
|
// empty request
|
|
message MovedResponse {}
|
|
|
|
// a tuple indicating row and column
|
|
message RowCol {
|
|
int32 row = 1;
|
|
int32 col = 2;
|
|
}
|
|
|
|
// cursor position object
|
|
message CursorPosition {
|
|
// path of current buffer this cursor is into
|
|
string buffer = 1;
|
|
// cursor start position
|
|
RowCol start = 2;
|
|
// cursor end position
|
|
RowCol end = 3;
|
|
}
|
|
|
|
// cursor event, with user id and cursor position
|
|
message CursorEvent {
|
|
// user moving the cursor
|
|
string user = 1;
|
|
// new cursor position
|
|
CursorPosition position = 2;
|
|
}
|
|
|
|
// payload identifying user for cursor attaching
|
|
message UserIdentity {
|
|
// user identifier
|
|
string id = 1;
|
|
}
|