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:
12
frontend/rust-lib/flowy-database-pub/Cargo.toml
Normal file
12
frontend/rust-lib/flowy-database-pub/Cargo.toml
Normal file
@ -0,0 +1,12 @@
|
||||
[package]
|
||||
name = "flowy-database-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 }
|
||||
collab-entity = { version = "0.1.0" }
|
||||
collab = { version = "0.1.0" }
|
||||
anyhow.workspace = true
|
43
frontend/rust-lib/flowy-database-pub/src/cloud.rs
Normal file
43
frontend/rust-lib/flowy-database-pub/src/cloud.rs
Normal file
@ -0,0 +1,43 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use anyhow::Error;
|
||||
use collab::core::collab::CollabDocState;
|
||||
use collab_entity::CollabType;
|
||||
|
||||
use lib_infra::future::FutureResult;
|
||||
|
||||
pub type CollabDocStateByOid = HashMap<String, CollabDocState>;
|
||||
|
||||
/// A trait for database cloud service.
|
||||
/// Each kind of server should implement this trait. Check out the [AppFlowyServerProvider] of
|
||||
/// [flowy-server] crate for more information.
|
||||
pub trait DatabaseCloudService: Send + Sync {
|
||||
/// The suffix 'db' in the method name serves as a workaround to avoid naming conflicts with the existing method `get_collab_doc_state`.
|
||||
fn get_collab_doc_state_db(
|
||||
&self,
|
||||
object_id: &str,
|
||||
collab_type: CollabType,
|
||||
workspace_id: &str,
|
||||
) -> FutureResult<CollabDocState, Error>;
|
||||
|
||||
/// The suffix 'db' in the method name serves as a workaround to avoid naming conflicts with the existing method `get_collab_doc_state`.
|
||||
fn batch_get_collab_doc_state_db(
|
||||
&self,
|
||||
object_ids: Vec<String>,
|
||||
object_ty: CollabType,
|
||||
workspace_id: &str,
|
||||
) -> FutureResult<CollabDocStateByOid, Error>;
|
||||
|
||||
fn get_collab_snapshots(
|
||||
&self,
|
||||
object_id: &str,
|
||||
limit: usize,
|
||||
) -> FutureResult<Vec<DatabaseSnapshot>, Error>;
|
||||
}
|
||||
|
||||
pub struct DatabaseSnapshot {
|
||||
pub snapshot_id: i64,
|
||||
pub database_id: String,
|
||||
pub data: Vec<u8>,
|
||||
pub created_at: i64,
|
||||
}
|
1
frontend/rust-lib/flowy-database-pub/src/lib.rs
Normal file
1
frontend/rust-lib/flowy-database-pub/src/lib.rs
Normal file
@ -0,0 +1 @@
|
||||
pub mod cloud;
|
Reference in New Issue
Block a user