Nathan.fooo 3e17613f54
tests: AppFlowy Cloud integration test (#4015)
* chore: save cloud ofnig

* chore: fix .a link warnings

* chore: add cloud test runner

* refactor: test folder

* ci: add test

* ci: add test

* ci: fix

* ci: fix
2023-11-28 10:54:31 +08:00

39 lines
1.1 KiB
Rust

use std::collections::HashMap;
use serde::Deserialize;
use flowy_server_config::af_cloud_config::AFCloudConfiguration;
use flowy_server_config::supabase_config::SupabaseConfiguration;
use flowy_server_config::AuthenticatorType;
#[derive(Deserialize, Debug)]
pub struct AppFlowyDartConfiguration {
/// The root path of the application
pub root: String,
/// This path will be used to store the user data
pub custom_app_path: String,
pub origin_app_path: String,
pub device_id: String,
pub authenticator_type: AuthenticatorType,
pub(crate) supabase_config: SupabaseConfiguration,
pub(crate) appflowy_cloud_config: AFCloudConfiguration,
#[serde(default)]
pub(crate) envs: HashMap<String, String>,
}
impl AppFlowyDartConfiguration {
pub fn from_str(s: &str) -> Self {
serde_json::from_str::<AppFlowyDartConfiguration>(s).unwrap()
}
pub fn write_env(&self) {
self.authenticator_type.write_env();
self.appflowy_cloud_config.write_env();
self.supabase_config.write_env();
for (k, v) in self.envs.iter() {
std::env::set_var(k, v);
}
}
}