syntax = "proto3"; package 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; }