mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-22 15:34:53 +01:00
feat: initial rework of protocol flow
Added a "session" stage, to auth and connect to a Workspace. Added workspace-level operations (sync, get buffers list...). Added buffer-level sync operations (push, pull).
This commit is contained in:
parent
4491482b0a
commit
83ae6e3cd1
3 changed files with 22 additions and 14 deletions
|
@ -3,6 +3,8 @@ package buffer;
|
||||||
|
|
||||||
service Buffer {
|
service Buffer {
|
||||||
rpc Attach (stream Operation) returns (stream Operation);
|
rpc Attach (stream Operation) returns (stream Operation);
|
||||||
|
rpc Push (BufferPayload) returns (BufferResponse);
|
||||||
|
rpc Pull (BufferPayload) returns (BufferPayload);
|
||||||
}
|
}
|
||||||
|
|
||||||
message Operation {
|
message Operation {
|
||||||
|
@ -20,3 +22,15 @@ message Operation {
|
||||||
|
|
||||||
optional string text = 5;
|
optional string text = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message BufferPayload {
|
||||||
|
string sessionKey = 1;
|
||||||
|
string path = 2;
|
||||||
|
optional string content = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message BufferResponse {
|
||||||
|
string sessionKey = 1;
|
||||||
|
string path = 2;
|
||||||
|
bool accepted = 3;
|
||||||
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ service Session {
|
||||||
}
|
}
|
||||||
|
|
||||||
message SessionRequest {
|
message SessionRequest {
|
||||||
optional string sessionKey = 1;
|
string sessionKey = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SessionResponse {
|
message SessionResponse {
|
||||||
|
|
|
@ -2,26 +2,20 @@ syntax = "proto3";
|
||||||
package workspace;
|
package workspace;
|
||||||
|
|
||||||
service Workspace {
|
service Workspace {
|
||||||
rpc Buffers (WorkspaceRequest) returns (BufferList);
|
rpc Subscribe (WorkspaceRequest) returns (stream Event);
|
||||||
rpc Push (BufferPayload) returns (WorkspaceResponse);
|
rpc Buffers (WorkspaceRequest) returns (BufferList);
|
||||||
rpc Pull (BufferPayload) returns (BufferPayload);
|
}
|
||||||
|
|
||||||
|
message Event {
|
||||||
|
int32 id = 1;
|
||||||
|
optional string body = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message WorkspaceRequest {
|
message WorkspaceRequest {
|
||||||
string sessionKey = 1;
|
string sessionKey = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message WorkspaceResponse {
|
|
||||||
string sessionKey = 1;
|
|
||||||
bool accepted = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message BufferList {
|
message BufferList {
|
||||||
repeated string path = 1;
|
repeated string path = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message BufferPayload {
|
|
||||||
string sessionKey = 1;
|
|
||||||
string path = 2;
|
|
||||||
optional string content = 3;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue