diff --git a/proto/buffer_service.proto b/proto/buffer_service.proto index 0e6e0ca..a10250a 100644 --- a/proto/buffer_service.proto +++ b/proto/buffer_service.proto @@ -5,22 +5,11 @@ package buffer_service; // handle buffer changes, keep in sync users service Buffer { // attach to a buffer and receive operations - rpc Attach (stream Operation) returns (stream Operation); - - rpc Snapshot(SnapshotRequest) returns (SnapshotResponse); - + rpc Attach (stream Operation) returns (stream Operation); } message Operation { required bytes data = 1; optional string user = 2; optional string path = 3; -} - -message SnapshotRequest { - required string path = 1; -} - -message SnapshotResponse { - required string content = 1; } \ No newline at end of file diff --git a/proto/files.proto b/proto/files.proto index a7ab7d2..4423582 100644 --- a/proto/files.proto +++ b/proto/files.proto @@ -2,7 +2,6 @@ syntax = "proto2"; package files; - message BufferNode { required string path = 1; } diff --git a/proto/workspace.proto b/proto/workspace.proto index 3bb467d..b333a32 100644 --- a/proto/workspace.proto +++ b/proto/workspace.proto @@ -40,7 +40,6 @@ enum FileEventType { message FileEvent { required string bufferbuffertree = 1; - required FileEventType type = 2; } @@ -59,9 +58,7 @@ message BufferPayload { required string path = 1; } -message BufferListRequest{ - -} +message BufferListRequest {} message UserList { repeated user.UserIdentity users = 1; diff --git a/proto/workspace_service.proto b/proto/workspace_service.proto index 3fe7c2e..54fe77b 100644 --- a/proto/workspace_service.proto +++ b/proto/workspace_service.proto @@ -6,23 +6,13 @@ import "files.proto"; import "workspace.proto"; service Workspace { - rpc Attach (workspace.AttachRequest) returns (workspace.Token); - rpc LeaveWorkspace (workspace.WorkspaceDetails) returns (workspace.Empty); - rpc CreateWorkspace (workspace.WorkspaceDetails) returns (workspace.Empty); - rpc CreateBuffer (workspace.BufferPayload) returns (workspace.Empty); - 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 Delete (workspace.BufferPayload) returns (workspace.Empty); //deletes buffer - } \ No newline at end of file diff --git a/src/workspace.rs b/src/workspace.rs index 4fe18b6..79da51c 100644 --- a/src/workspace.rs +++ b/src/workspace.rs @@ -2,7 +2,7 @@ use std::{collections::{BTreeMap, BTreeSet}, sync::Arc}; use tokio::sync::mpsc; use uuid::Uuid; use crate::{ - proto::{buffer_service::SnapshotRequest, user::UserIdentity, workspace::{AttachRequest, BufferListRequest, BufferPayload, Token, UserListRequest}}, + proto::{user::UserIdentity, workspace::{AttachRequest, BufferListRequest, BufferPayload, Token, UserListRequest}}, api::controller::ControllerWorker, buffer::{self, worker::BufferWorker}, client::Services, @@ -112,16 +112,6 @@ impl Workspace { Ok(controller) } - /// get a snapshot of a buffer (meaning its contents as a flat string) - pub async fn snapshot(&self, path: &str) -> crate::Result { - let mut buffer_client = self.services.buffer.clone(); - let contents = buffer_client.snapshot( - tonic::Request::new(SnapshotRequest { path: path.to_string() }) - ).await?.into_inner().content; - - Ok(contents) - } - /// fetch a list of all buffers in a workspace pub async fn fetch_buffers(&mut self) -> crate::Result<()> { let mut workspace_client = self.services.workspace.clone();