28 lines
827 B
Rust
Raw Normal View History

2022-02-26 11:03:42 +08:00
pub mod block_editor;
mod entities;
mod event_handler;
pub mod event_map;
2022-02-18 23:04:55 +08:00
pub mod manager;
mod queue;
mod web_socket;
pub mod protobuf;
2022-02-18 23:04:55 +08:00
pub use manager::*;
2021-12-14 18:04:51 +08:00
pub mod errors {
pub use flowy_error::{internal_error, ErrorCode, FlowyError};
}
2022-01-10 23:45:59 +08:00
2022-02-18 23:04:55 +08:00
pub const DOCUMENT_SYNC_INTERVAL_IN_MILLIS: u64 = 1000;
2022-01-10 23:45:59 +08:00
use crate::errors::FlowyError;
2022-03-02 21:12:21 +08:00
use flowy_collaboration::entities::document_info::{BlockId, BlockInfo, CreateBlockParams, ResetBlockParams};
2022-01-10 23:45:59 +08:00
use lib_infra::future::FutureResult;
2022-02-25 22:27:44 +08:00
pub trait BlockCloudService: Send + Sync {
fn create_block(&self, token: &str, params: CreateBlockParams) -> FutureResult<(), FlowyError>;
2022-01-10 23:45:59 +08:00
2022-02-25 22:27:44 +08:00
fn read_block(&self, token: &str, params: BlockId) -> FutureResult<Option<BlockInfo>, FlowyError>;
2022-01-10 23:45:59 +08:00
2022-03-02 21:12:21 +08:00
fn update_block(&self, token: &str, params: ResetBlockParams) -> FutureResult<(), FlowyError>;
2022-01-10 23:45:59 +08:00
}