feat: adding an initial proto version for the workspace event stream

This commit is contained in:
Camillo Schenone 2024-02-04 13:25:26 +01:00
parent 4ae31df3ff
commit d14f004f73
2 changed files with 17 additions and 3 deletions

View file

@ -19,6 +19,20 @@ message WorkspaceMessage {
required string id = 1; //unused??? required string id = 1; //unused???
} }
enum WorkspaceEventType {
USER_JOIN = 0;
USER_LEAVE = 1;
FILE_CREATE = 2;
FILE_DELETE = 3;
FILE_RENAME = 4;
}
message WorkspaceEvent {
required string id = 1; // the id of the user, or the path of the file
required WorkspaceEventType event = 2;
optional string extra = 3; // new name? extra info on user events etc...
}
message JoinRequest { message JoinRequest {
required string username = 1; required string username = 1;
required string password = 2; required string password = 2;
@ -66,4 +80,4 @@ message UserList {
message WorkspaceDetails { message WorkspaceDetails {
required string id = 1; required string id = 1;
} }

View file

@ -13,6 +13,6 @@ service Workspace {
rpc ListBuffers (workspace.BufferListRequest) returns (files.BufferTree); rpc ListBuffers (workspace.BufferListRequest) returns (files.BufferTree);
rpc ListUsers (workspace.UserListRequest) returns (workspace.UserList); rpc ListUsers (workspace.UserListRequest) returns (workspace.UserList);
rpc ListBufferUsers (workspace.BufferPayload) returns (workspace.UserList); //TODO discuss rpc ListBufferUsers (workspace.BufferPayload) returns (workspace.UserList); //TODO discuss
rpc Join (workspace.JoinRequest) returns (workspace.Token); rpc Join (workspace.JoinRequest) returns (stream workspace.WorkspaceEvent);
rpc Delete (workspace.BufferPayload) returns (workspace.Empty); //deletes buffer rpc Delete (workspace.BufferPayload) returns (workspace.Empty); //deletes buffer
} }