add default veilid config to the api

This commit is contained in:
Christien Rioux
2024-03-02 11:32:08 -05:00
parent 31bb8018f6
commit 8818e63dc0
17 changed files with 242 additions and 126 deletions

View File

@@ -88,6 +88,11 @@ pub fn veilid_version() -> (u32, u32, u32) {
)
}
/// Return the default veilid config as a json object
pub fn default_veilid_config() -> String {
serialize_json(VeilidConfigInner::default())
}
#[cfg(target_os = "android")]
pub use intf::android::veilid_core_setup_android;

View File

@@ -120,6 +120,7 @@ pub enum RequestOp {
},
VeilidVersionString,
VeilidVersion,
DefaultVeilidConfig,
}
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
@@ -230,6 +231,9 @@ pub enum ResponseOp {
minor: u32,
patch: u32,
},
DefaultVeilidConfig {
value: String,
},
}
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]

View File

@@ -792,6 +792,9 @@ impl JsonRequestProcessor {
patch,
}
}
RequestOp::DefaultVeilidConfig => ResponseOp::DefaultVeilidConfig {
value: default_veilid_config(),
},
};
Response { id, op }