moved some messages from workspace_service to files

This commit is contained in:
frelodev 2024-01-01 23:29:35 +01:00
parent 6230371020
commit 85add1ca0d
5 changed files with 22 additions and 11 deletions

View file

@ -7,6 +7,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
&[ &[
"proto/user.proto", "proto/user.proto",
"proto/cursor.proto", "proto/cursor.proto",
"proto/files.proto",
"proto/buffer_service.proto", "proto/buffer_service.proto",
"proto/cursor_service.proto", "proto/cursor_service.proto",
"proto/workspace_service.proto" "proto/workspace_service.proto"

View file

@ -0,0 +1,17 @@
syntax = "proto2";
package files;
message BufferNode{
required string path = 1;
}
message BufferTree{
repeated BufferNode buffers = 1;
}
message WorkspaceFileTree {
// list of strings may be more efficient but it's a lot more hassle
required string payload = 1; // spappolata di json
} //Alla fine non si usa questo per ora ma BufferTree

0
proto/workspace.proto Normal file
View file

View file

@ -26,15 +26,13 @@ syntax = "proto2";
package workspace_service; package workspace_service;
import "user.proto"; import "user.proto";
import "files.proto";
message Empty {} message Empty {}
message WorkspaceFileTree {
// list of strings may be more efficient but it's a lot more hassle
required string payload = 1; // spappolata di json
}
message WorkspaceUserList { message WorkspaceUserList {
repeated user.UserIdentity user = 1; repeated user.UserIdentity user = 1;
@ -57,7 +55,7 @@ service Workspace {
rpc Attach (AttachRequest) returns (Token); rpc Attach (AttachRequest) returns (Token);
rpc ListBuffers (BufferListRequest) returns (BufferTree); rpc ListBuffers (BufferListRequest) returns (files.BufferTree);
rpc ListUsers (UserListRequest) returns (UserList); rpc ListUsers (UserListRequest) returns (UserList);
@ -125,13 +123,7 @@ message BufferListRequest{
} }
message BufferNode{
required string path = 1;
}
message BufferTree{
repeated BufferNode buffers = 1;
}
message UserList{ message UserList{
repeated user.UserIdentity users = 1; repeated user.UserIdentity users = 1;

View file

@ -167,6 +167,7 @@ pub use woot;
pub mod proto { pub mod proto {
pub mod user { tonic::include_proto!("user"); } pub mod user { tonic::include_proto!("user"); }
pub mod cursor { tonic::include_proto!("cursor"); } pub mod cursor { tonic::include_proto!("cursor"); }
pub mod files { tonic::include_proto!("files"); }
pub mod buffer_service { tonic::include_proto!("buffer_service"); } pub mod buffer_service { tonic::include_proto!("buffer_service"); }
pub mod cursor_service { tonic::include_proto!("cursor_service"); } pub mod cursor_service { tonic::include_proto!("cursor_service"); }
pub mod workspace_service { tonic::include_proto!("workspace_service"); } pub mod workspace_service { tonic::include_proto!("workspace_service"); }