diff --git a/Cargo.toml b/Cargo.toml index 9acc687..d95e446 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] edition = "2021" name = "nacos-sdk-rust-binding-node" -version = "0.3.3" +version = "0.3.5" authors = ["CheirshCai <785427346@qq.com>"] license = "Apache-2.0" readme = "README.md" @@ -18,7 +18,7 @@ crate-type = ["cdylib"] napi = { version = "2", default-features = false, features = ["napi4", "async"] } napi-derive = "2" -nacos-sdk = { version = "0.3.3", features = ["async"] } +nacos-sdk = { version = "0.3.5", features = ["async"] } #nacos-sdk = { git = "https://github.com/nacos-group/nacos-sdk-rust.git", branch = "main", features = ["async"] } tracing-subscriber = { version = "0.3", features = ["default"] } diff --git a/index.d.ts b/index.d.ts index 8ab06d0..959d227 100644 --- a/index.d.ts +++ b/index.d.ts @@ -17,6 +17,8 @@ export interface ClientOptions { password?: string /** naming push_empty_protection, default true */ namingPushEmptyProtection?: boolean + /** naming load_cache_at_start, default false */ + namingLoadCacheAtStart?: boolean } export interface NacosConfigResponse { /** Namespace/Tenant */ diff --git a/src/lib.rs b/src/lib.rs index f1e1213..7fcad4a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -56,6 +56,8 @@ pub struct ClientOptions { pub password: Option, /// naming push_empty_protection, default true pub naming_push_empty_protection: Option, + /// naming load_cache_at_start, default false + pub naming_load_cache_at_start: Option, } mod config; diff --git a/src/naming.rs b/src/naming.rs index b739365..fa1440d 100644 --- a/src/naming.rs +++ b/src/naming.rs @@ -25,7 +25,8 @@ impl NacosNamingClient { .app_name .unwrap_or(nacos_sdk::api::constants::UNKNOWN.to_string()), ) - .naming_push_empty_protection(client_options.naming_push_empty_protection.unwrap_or(true)); + .naming_push_empty_protection(client_options.naming_push_empty_protection.unwrap_or(true)) + .naming_load_cache_at_start(client_options.naming_load_cache_at_start.unwrap_or(false)); // need enable_auth_plugin_http with username & password let is_enable_auth = client_options.username.is_some() && client_options.password.is_some();