A personal temporary Nacos API, forked from Squbirreland/nacos-api.
```rust use nacos_api::{NacosClient, NacosConfig, ServerConfig};
async fn main() { let nacos = NacosConfig::new("http", "192.168.0.132", 8848); let client = NacosClient::new( &nacos, ServerConfig::new("127.0.0.1", 8080, "test"), );
client.register(&None).await;
loop {}
} ```
```rust pub async fn tryreqserver() { use nacos_api::{NacosClient, NacosConfig, ServerConfig};
let nacos = NacosConfig::new("http", "192.168.0.132", 8848);
let client = NacosClient::new(
&nacos,
ServerConfig::new("127.0.0.1", 8080, "test"),
);
let addr = client.get_addr_simple("test").await?;
assert!("http://127.0.0.1:8080", addr.as_str());
} ```
```rust use nacos_api::{NacosConfigClient, NacosConfigApi, DeployConfig, NacosConfig};
async fn main() { let client = NacosConfigClient::new("testdata", "testgrep", None); let nacosconfig = NacosConfig::new("http", "192.168.0.132", 8848); // listen the nacos configs center client.listenconfig( &nacos_config, |s| { println!(" perceive the configs changed to > {}", s) }, 10 ).await; // make the program keep alive loop {} } ```
development by nacos v2.0.1