mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-02-25 18:55:38 -06:00
add default veilid config to the api
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -792,6 +792,9 @@ impl JsonRequestProcessor {
|
||||
patch,
|
||||
}
|
||||
}
|
||||
RequestOp::DefaultVeilidConfig => ResponseOp::DefaultVeilidConfig {
|
||||
value: default_veilid_config(),
|
||||
},
|
||||
};
|
||||
|
||||
Response { id, op }
|
||||
|
||||
Reference in New Issue
Block a user