2021-06-30 15:11:27 +00:00
|
|
|
pub mod module;
|
|
|
|
pub use module::*;
|
|
|
|
|
2021-07-08 13:23:44 +00:00
|
|
|
use flowy_dispatch::prelude::*;
|
2021-06-30 15:11:27 +00:00
|
|
|
use module::build_modules;
|
2021-07-09 15:31:44 +00:00
|
|
|
|
2021-06-28 15:58:43 +00:00
|
|
|
pub struct FlowySDK {}
|
|
|
|
|
|
|
|
impl FlowySDK {
|
2021-07-03 06:14:10 +00:00
|
|
|
pub fn init_log(directory: &str) { flowy_log::init_log("flowy", directory, "Debug").unwrap(); }
|
2021-06-28 15:58:43 +00:00
|
|
|
|
2021-07-02 12:47:52 +00:00
|
|
|
pub fn init(path: &str) {
|
2021-07-11 07:33:19 +00:00
|
|
|
tracing::info!("🔥 Root path: {}", path);
|
|
|
|
|
|
|
|
flowy_infra::kv::KVStore::init(path);
|
2021-07-09 15:31:44 +00:00
|
|
|
|
|
|
|
let config = ModuleConfig {
|
|
|
|
root: path.to_string(),
|
|
|
|
};
|
|
|
|
|
|
|
|
EventDispatch::construct(|| build_modules(config));
|
2021-06-30 15:11:27 +00:00
|
|
|
}
|
2021-06-28 15:58:43 +00:00
|
|
|
}
|