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:
Nathan.fooo
2024-01-11 14:42:03 +08:00
committed by GitHub
parent dd8b9dd43e
commit 307556b7dd
133 changed files with 362 additions and 382 deletions

View 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

View 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,
}

View File

@ -0,0 +1 @@
pub mod cloud;