Skip to content

Commit

Permalink
bump: version=0.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
CherishCai committed Mar 12, 2024
1 parent c4e3453 commit c350c1b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nacos-sdk-rust-binding-py"
version = "0.3.3"
version = "0.3.5"
edition = "2021"
license = "Apache-2.0"
publish = false
Expand All @@ -20,7 +20,7 @@ doc = false
[dependencies]
pyo3 = "0.18"

nacos-sdk = { version = "0.3.3", features = ["default"] }
nacos-sdk = { version = "0.3.5", features = ["default"] }
#nacos-sdk = { git = "https://github.com/nacos-group/nacos-sdk-rust.git", features = ["default"] }

tracing-subscriber = { version = "0.3", features = ["default"] }
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class ClientOptions:
# naming push_empty_protection, default true
#[pyo3(set, get)]
naming_push_empty_protection: Option<bool>,
# naming load_cache_at_start, default false
#[pyo3(set, get)]
naming_load_cache_at_start: Option<bool>,

# Init
def __init__(self, server_addr, namespace, app_name, username, password):
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ pub struct ClientOptions {
/// naming push_empty_protection, default true
#[pyo3(set, get)]
pub naming_push_empty_protection: Option<bool>,
/// naming load_cache_at_start, default false
#[pyo3(set, get)]
pub naming_load_cache_at_start: Option<bool>,
}

#[pymethods]
Expand All @@ -85,6 +88,7 @@ impl ClientOptions {
username: Option<String>,
password: Option<String>,
naming_push_empty_protection: Option<bool>,
naming_load_cache_at_start: Option<bool>,
) -> PyResult<ClientOptions> {
Ok(Self {
server_addr,
Expand All @@ -93,6 +97,7 @@ impl ClientOptions {
username,
password,
naming_push_empty_protection,
naming_load_cache_at_start,
})
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/naming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ impl NacosNamingClient {
)
.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();
Expand Down

0 comments on commit c350c1b

Please sign in to comment.