Crates.io | clia-nacos-api |
lib.rs | clia-nacos-api |
version | |
source | src |
created_at | 2022-04-02 08:45:29.986617+00 |
updated_at | 2025-03-04 05:37:05.974129+00 |
description | A personal temporary Nacos API, forked from Squbirreland/nacos-api. |
homepage | |
repository | https://github.com/clia/clia-nacos-api |
max_upload_size | |
id | 560754 |
Cargo.toml error: | TOML parse error at line 32, column 1 | 32 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A personal temporary Nacos API, forked from Squbirreland/nacos-api.
use nacos_api::{NacosClient, NacosConfig, ServerConfig};
#[tokio::main]
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 {}
}
pub async fn try_req_server() {
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());
}
use nacos_api::{NacosConfigClient, NacosConfigApi, DeployConfig, NacosConfig};
#[tokio::main]
async fn main() {
let client = NacosConfigClient::new("test_data", "test_grep", None);
let nacos_config = NacosConfig::new("http", "192.168.0.132", 8848);
// listen the nacos configs center
client.listen_config(
&nacos_config,
|s| { println!(" perceive the configs changed to > {}", s) },
10
).await;
// make the program keep alive
loop {}
}
development by nacos v2.0.1