mirror of
https://github.com/hexedtech/codemp.git
synced 2024-10-23 02:09:20 +02:00
56 lines
1.3 KiB
Protocol Buffer
56 lines
1.3 KiB
Protocol Buffer
syntax = "proto2";
|
|
|
|
package workspace;
|
|
import "files.proto";
|
|
import "auth.proto";
|
|
import "common.proto";
|
|
|
|
service Workspace {
|
|
rpc CreateWorkspace (workspace.WorkspaceId) returns (common.Empty);
|
|
|
|
rpc RequestAccess (workspace.BufferPath) returns (auth.Token);
|
|
rpc LeaveWorkspace (workspace.WorkspaceId) returns (common.Empty);
|
|
rpc CreateBuffer (workspace.BufferPath) returns (common.Empty);
|
|
rpc ListBuffers (common.Empty) returns (files.BufferTree);
|
|
rpc ListUsers (common.Empty) returns (common.UserList);
|
|
rpc ListBufferUsers (workspace.BufferPath) returns (common.UserList); //TODO discuss
|
|
rpc Attach (common.Empty) returns (stream workspace.WorkspaceEvent);
|
|
rpc Delete (workspace.BufferPath) returns (common.Empty); //deletes buffer
|
|
}
|
|
|
|
message WorkspaceEvent {
|
|
message UserJoin {
|
|
required common.UserIdentity id = 1;
|
|
}
|
|
message UserLeave {
|
|
required common.UserIdentity id = 1;
|
|
}
|
|
message FileCreate {
|
|
required string path = 1;
|
|
}
|
|
message FileRename {
|
|
required string before = 1;
|
|
required string after = 2;
|
|
}
|
|
message FileDelete {
|
|
required string path = 1;
|
|
}
|
|
|
|
oneof event {
|
|
UserJoin join = 1;
|
|
UserLeave leave = 2;
|
|
FileCreate create = 3;
|
|
FileRename rename = 4;
|
|
FileDelete delete = 5;
|
|
}
|
|
}
|
|
|
|
message BufferPath {
|
|
// buffer path to operate onto
|
|
required string path = 1;
|
|
}
|
|
|
|
|
|
message WorkspaceId {
|
|
required string id = 1;
|
|
}
|