fn _register_discovery_config()

in shenyu-client-rust/src/core.rs [416:454]


    fn _register_discovery_config(
        &self,
        discovery_type: &str,
        register_path: &str,
        server_lists: &str,
        props: &HashMap<String, String>,
        plugin_name: &str,
        context_path: &str,
        namespace_id: &str,
        host: &Option<String>,
        port: &u16,
    ) {
        let json_data = serde_json::json!({
            "name": "default".to_string() + discovery_type,
            "selectorName": context_path,
            "handler": "{}",
            "listenerNode":register_path,
            "serverList": server_lists,
            "props": props,
            "discoveryType": discovery_type,
            "pluginName": plugin_name,
            "namespaceId": namespace_id,
        });

        // Broadcast to all shenyu admin.
        for url in &self.register_discover_config_servers {
            if let Ok(true) = self.request(url, &json_data) {
                info!(
                    "[SUCCESS], register discover config success, register data: {:#?}",
                    &json_data
                );
                continue;
            }
            error!(
                "[ERROR], register discover config to {} failed, discovery_type: {}, host: {}, port: {}",
                url, discovery_type, host.clone().unwrap(), port
            );
        }
    }