use crate::api::MStorageClient;
use crate::module::Module;
pub struct Backend {
pub mstorage_api: MStorageClient,
}
impl Default for Backend {
fn default() -> Self {
Self::new()
}
}
impl Backend {
pub fn new() -> Self {
let param_name = "main_module_url";
let mstorage_api = if let Some(url) = Module::get_property(param_name) {
MStorageClient::new(url)
} else {
error!("not found param {} in properties file", param_name);
MStorageClient::new("".to_owned())
};
Backend { mstorage_api }
}
}