diff --git a/proto/workspace.proto b/proto/workspace.proto index b333a32..bafda01 100644 --- a/proto/workspace.proto +++ b/proto/workspace.proto @@ -19,6 +19,20 @@ message WorkspaceMessage { 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 { required string username = 1; required string password = 2; @@ -66,4 +80,4 @@ message UserList { message WorkspaceDetails { required string id = 1; -} \ No newline at end of file +} diff --git a/proto/workspace_service.proto b/proto/workspace_service.proto index 54fe77b..597dc5a 100644 --- a/proto/workspace_service.proto +++ b/proto/workspace_service.proto @@ -13,6 +13,6 @@ service Workspace { rpc ListBuffers (workspace.BufferListRequest) returns (files.BufferTree); rpc ListUsers (workspace.UserListRequest) returns (workspace.UserList); 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 -} \ No newline at end of file +}