From be475fc5cb46deff2bc7a1c97cd010f9976e8727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cherish=20=E8=94=A1=E6=A2=A6=E7=BC=98?= <785427346@qq.com> Date: Sun, 25 Sep 2022 14:14:43 +0800 Subject: [PATCH] feat: crate name change to nacos-sdk (#7) * feat: crate name change to nacos-sdk * fix: CHANGELOG.md * fix: invalid length 7, expected at most 5 keywords per crate * fix: invalid length 24, expected a keyword with less than 20 characters * upgrade: 0.1.1, exclude build.rs --- CHANGELOG.md | 12 ++++++++++++ Cargo.toml | 18 ++++++++++++++---- README.md | 2 +- examples/simple_app.rs | 6 +++--- src/api/config.rs | 8 ++++---- src/lib.rs | 11 +++++------ 6 files changed, 39 insertions(+), 18 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..cdbd2c6 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# 变更日志 | Change log + +### 0.1.1 + +- Config 模块基本可用 +- 欢迎更多贡献、修复和标准化 api + +--- + +- The module of Config basically available +- Welcome more contributions, fixes and standardized APIs + diff --git a/Cargo.toml b/Cargo.toml index 6547e2a..c505bbd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,9 +17,19 @@ # [package] -name = "nacos-client" -version = "0.1.0" +name = "nacos-sdk" +version = "0.1.1" edition = "2021" +authors = ["nacos-group", "CheirshCai <785427346@qq.com>", "onewe <2583021406@qq.com>"] +license = "Apache-2.0" +readme = "README.md" +documentation = "https://docs.rs/nacos-sdk/latest" +repository = "https://github.com/nacos-group/nacos-sdk-rust" +homepage = "https://nacos.io/en-us/" +description = "Nacos client in Rust." +categories = ["network-programming", "development-tools"] +keywords = ["microservices", "config", "naming", "service-discovery", "config-management"] +exclude = [".github", "proto", "build.rs"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] @@ -30,7 +40,7 @@ naming = [] [dependencies] thiserror = "1.0" tokio = { version = "1.21", features = ["full"] } -tokio-stream = { version = "0.1", features = ["net"] } +#tokio-stream = { version = "0.1", features = ["net"] } futures = "0.3" grpcio = { version = "0.11", default-features = false, features = ["prost-codec"] } prost = "0.10" @@ -43,7 +53,7 @@ lazy_static = "1.4" #async-trait = "0" #async_once = "0" -opentelemetry = "0" +#opentelemetry = "0" tracing = "0.1" local_ipaddress = "0.1.3" diff --git a/README.md b/README.md index 08fb756..e4edd10 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Add the dependency in `Cargo.toml`: ```toml [dependencies] -nacos-client = { version = "0.1.0", features = ["default"] } +nacos-sdk = { version = "0.1", features = ["default"] } ``` ### Usage of Config diff --git a/examples/simple_app.rs b/examples/simple_app.rs index 8416d7b..d12a609 100644 --- a/examples/simple_app.rs +++ b/examples/simple_app.rs @@ -1,6 +1,6 @@ -use nacos_client::api::config::ConfigService; -use nacos_client::api::config::ConfigServiceBuilder; -use nacos_client::api::props::ClientProps; +use nacos_sdk::api::config::ConfigService; +use nacos_sdk::api::config::ConfigServiceBuilder; +use nacos_sdk::api::props::ClientProps; use std::time::Duration; use tokio::time::sleep; diff --git a/src/api/config.rs b/src/api/config.rs index 23e06e9..2da6e33 100644 --- a/src/api/config.rs +++ b/src/api/config.rs @@ -8,8 +8,8 @@ pub(crate) type ConfigChangeListener = dyn Fn(ConfigResponse) + Send + Sync; /// # Examples /// /// ```rust -/// let mut config_service = nacos_client::api::config::ConfigServiceBuilder::new( -/// nacos_client::api::props::ClientProps::new() +/// let mut config_service = nacos_sdk::api::config::ConfigServiceBuilder::new( +/// nacos_sdk::api::props::ClientProps::new() /// .server_addr("0.0.0.0:9848") /// // Attention! "public" is "", it is recommended to customize the namespace with clear meaning. /// .namespace("") @@ -112,8 +112,8 @@ impl ConfigResponse { /// # Examples /// /// ```rust -/// let mut config_service = nacos_client::api::config::ConfigServiceBuilder::new( -/// nacos_client::api::props::ClientProps::new() +/// let mut config_service = nacos_sdk::api::config::ConfigServiceBuilder::new( +/// nacos_sdk::api::props::ClientProps::new() /// .server_addr("0.0.0.0:9848") /// // Attention! "public" is "", it is recommended to customize the namespace with clear meaning. /// .namespace("") diff --git a/src/lib.rs b/src/lib.rs index 3b787fa..6fad0b9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,7 +27,7 @@ //! //! ```toml //! [dependencies] -//! nacos-client = { version = "0.1.0", features = ["default"] } +//! nacos-sdk = { version = "0.1", features = ["default"] } //! ``` //! //! ## General Configurations and Initialization @@ -36,16 +36,15 @@ //! //! ### Example of Config //! -//! ```rust -//! let mut config_service = nacos_client::api::config::ConfigServiceBuilder::new( -//! nacos_client::api::props::ClientProps::new() +//! ```ignore +//! let mut config_service = nacos_sdk::api::config::ConfigServiceBuilder::new( +//! nacos_sdk::api::props::ClientProps::new() //! .server_addr("0.0.0.0:9848") //! // Attention! "public" is "", it is recommended to customize the namespace with clear meaning. //! .namespace("") //! .app_name("todo-your-app-name"), //! ) -//! .build()//.await -//! ; +//! .build().await; //! ``` //!