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