mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
refactor: deps crates (#4362)
* refactor: rename flowy-folder-deps to flowy-folder-pub * chore: rename crates * chore: move flowy-task to lib-infra * chore: rename crates * refactor: user manager dir
This commit is contained in:
13
frontend/rust-lib/flowy-document-pub/Cargo.toml
Normal file
13
frontend/rust-lib/flowy-document-pub/Cargo.toml
Normal file
@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "flowy-document-pub"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
lib-infra = { workspace = true }
|
||||
flowy-error = { workspace = true }
|
||||
collab-document = { version = "0.1.0" }
|
||||
anyhow.workspace = true
|
||||
collab = { version = "0.1.0" }
|
37
frontend/rust-lib/flowy-document-pub/src/cloud.rs
Normal file
37
frontend/rust-lib/flowy-document-pub/src/cloud.rs
Normal file
@ -0,0 +1,37 @@
|
||||
use anyhow::Error;
|
||||
use collab::core::collab::CollabDocState;
|
||||
pub use collab_document::blocks::DocumentData;
|
||||
|
||||
use flowy_error::FlowyError;
|
||||
use lib_infra::future::FutureResult;
|
||||
|
||||
/// A trait for document cloud service.
|
||||
/// Each kind of server should implement this trait. Check out the [AppFlowyServerProvider] of
|
||||
/// [flowy-server] crate for more information.
|
||||
pub trait DocumentCloudService: Send + Sync + 'static {
|
||||
fn get_document_doc_state(
|
||||
&self,
|
||||
document_id: &str,
|
||||
workspace_id: &str,
|
||||
) -> FutureResult<CollabDocState, FlowyError>;
|
||||
|
||||
fn get_document_snapshots(
|
||||
&self,
|
||||
document_id: &str,
|
||||
limit: usize,
|
||||
workspace_id: &str,
|
||||
) -> FutureResult<Vec<DocumentSnapshot>, Error>;
|
||||
|
||||
fn get_document_data(
|
||||
&self,
|
||||
document_id: &str,
|
||||
workspace_id: &str,
|
||||
) -> FutureResult<Option<DocumentData>, Error>;
|
||||
}
|
||||
|
||||
pub struct DocumentSnapshot {
|
||||
pub snapshot_id: i64,
|
||||
pub document_id: String,
|
||||
pub data: Vec<u8>,
|
||||
pub created_at: i64,
|
||||
}
|
1
frontend/rust-lib/flowy-document-pub/src/lib.rs
Normal file
1
frontend/rust-lib/flowy-document-pub/src/lib.rs
Normal file
@ -0,0 +1 @@
|
||||
pub mod cloud;
|
Reference in New Issue
Block a user