2022-02-18 15:04:55 +00:00
|
|
|
pub mod editor;
|
|
|
|
pub mod manager;
|
|
|
|
mod queue;
|
|
|
|
mod web_socket;
|
|
|
|
|
|
|
|
pub use manager::*;
|
2021-12-14 10:04:51 +00:00
|
|
|
pub mod errors {
|
|
|
|
pub use flowy_error::{internal_error, ErrorCode, FlowyError};
|
|
|
|
}
|
2022-01-10 15:45:59 +00:00
|
|
|
|
2022-02-18 15:04:55 +00:00
|
|
|
pub const DOCUMENT_SYNC_INTERVAL_IN_MILLIS: u64 = 1000;
|
|
|
|
|
2022-01-10 15:45:59 +00:00
|
|
|
use crate::errors::FlowyError;
|
2022-01-21 13:41:24 +00:00
|
|
|
use flowy_collaboration::entities::document_info::{CreateDocParams, DocumentId, DocumentInfo, ResetDocumentParams};
|
2022-01-10 15:45:59 +00:00
|
|
|
use lib_infra::future::FutureResult;
|
|
|
|
|
|
|
|
pub trait DocumentCloudService: Send + Sync {
|
|
|
|
fn create_document(&self, token: &str, params: CreateDocParams) -> FutureResult<(), FlowyError>;
|
|
|
|
|
|
|
|
fn read_document(&self, token: &str, params: DocumentId) -> FutureResult<Option<DocumentInfo>, FlowyError>;
|
|
|
|
|
|
|
|
fn update_document(&self, token: &str, params: ResetDocumentParams) -> FutureResult<(), FlowyError>;
|
|
|
|
}
|