nacos-sdk-rust-binding-node 0.1.0-PRE2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +3 -3
- package/example/config_decrypt.js +8 -1
- package/package.json +15 -15
- package/src/config.rs +2 -2
- package/src/lib.rs +0 -2
package/Cargo.toml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
edition = "2021"
|
|
3
3
|
name = "nacos-sdk-rust-binding-node"
|
|
4
|
-
version = "0.0
|
|
4
|
+
version = "0.1.0"
|
|
5
5
|
authors = ["CheirshCai <785427346@qq.com>"]
|
|
6
6
|
license = "Apache-2.0"
|
|
7
7
|
readme = "README.md"
|
|
@@ -18,8 +18,8 @@ crate-type = ["cdylib"]
|
|
|
18
18
|
napi = { version = "2", default-features = false, features = ["napi4", "async"] }
|
|
19
19
|
napi-derive = "2"
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
nacos-sdk = { git = "https://github.com/nacos-group/nacos-sdk-rust.git", features = ["async"] }
|
|
21
|
+
nacos-sdk = { version = "0.2.5", features = ["async"] }
|
|
22
|
+
#nacos-sdk = { git = "https://github.com/nacos-group/nacos-sdk-rust.git", features = ["async"] }
|
|
23
23
|
|
|
24
24
|
tracing-subscriber = { version = "0.3", features = ["env-filter", "local-time"] }
|
|
25
25
|
tracing-appender = "0.2"
|
|
@@ -12,8 +12,15 @@ const nacos_config_client = new NacosConfigClient(
|
|
|
12
12
|
(err, config_req, config_resp) => {
|
|
13
13
|
// config_req or config_resp only one not null. e.g. you can do encrypt for config_req, decrypt for config_resp.
|
|
14
14
|
if (config_resp != null) {
|
|
15
|
-
|
|
15
|
+
// TODO by customize and please care about encryptedDataKey whether not null
|
|
16
|
+
// config_resp.content = aes decrypt config_resp.content with config_resp.encryptedDataKey ??
|
|
17
|
+
config_resp.content = "func config_decrypt change it."
|
|
16
18
|
}
|
|
19
|
+
if (config_req != null) {
|
|
20
|
+
// TODO by customize and please care about encryptedDataKey whether not null
|
|
21
|
+
// config_req.content = aes encrypt config_req.content with config_req.encryptedDataKey ??
|
|
22
|
+
}
|
|
23
|
+
// !!! must return them !!!
|
|
17
24
|
return [config_req, config_resp];
|
|
18
25
|
}
|
|
19
26
|
);
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"binding",
|
|
8
8
|
"ffi"
|
|
9
9
|
],
|
|
10
|
-
"version": "0.1.0
|
|
10
|
+
"version": "0.1.0",
|
|
11
11
|
"bugs": "https://github.com/opc-source/nacos-sdk-rust-binding-node/issues",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"repository": {
|
|
@@ -55,19 +55,19 @@
|
|
|
55
55
|
},
|
|
56
56
|
"packageManager": "yarn@3.4.1",
|
|
57
57
|
"optionalDependencies": {
|
|
58
|
-
"nacos-sdk-rust-binding-node-win32-x64-msvc": "0.1.0
|
|
59
|
-
"nacos-sdk-rust-binding-node-darwin-x64": "0.1.0
|
|
60
|
-
"nacos-sdk-rust-binding-node-linux-x64-gnu": "0.1.0
|
|
61
|
-
"nacos-sdk-rust-binding-node-darwin-arm64": "0.1.0
|
|
62
|
-
"nacos-sdk-rust-binding-node-android-arm64": "0.1.0
|
|
63
|
-
"nacos-sdk-rust-binding-node-linux-arm64-gnu": "0.1.0
|
|
64
|
-
"nacos-sdk-rust-binding-node-linux-arm64-musl": "0.1.0
|
|
65
|
-
"nacos-sdk-rust-binding-node-win32-arm64-msvc": "0.1.0
|
|
66
|
-
"nacos-sdk-rust-binding-node-linux-arm-gnueabihf": "0.1.0
|
|
67
|
-
"nacos-sdk-rust-binding-node-linux-x64-musl": "0.1.0
|
|
68
|
-
"nacos-sdk-rust-binding-node-freebsd-x64": "0.1.0
|
|
69
|
-
"nacos-sdk-rust-binding-node-win32-ia32-msvc": "0.1.0
|
|
70
|
-
"nacos-sdk-rust-binding-node-android-arm-eabi": "0.1.0
|
|
71
|
-
"nacos-sdk-rust-binding-node-darwin-universal": "0.1.0
|
|
58
|
+
"nacos-sdk-rust-binding-node-win32-x64-msvc": "0.1.0",
|
|
59
|
+
"nacos-sdk-rust-binding-node-darwin-x64": "0.1.0",
|
|
60
|
+
"nacos-sdk-rust-binding-node-linux-x64-gnu": "0.1.0",
|
|
61
|
+
"nacos-sdk-rust-binding-node-darwin-arm64": "0.1.0",
|
|
62
|
+
"nacos-sdk-rust-binding-node-android-arm64": "0.1.0",
|
|
63
|
+
"nacos-sdk-rust-binding-node-linux-arm64-gnu": "0.1.0",
|
|
64
|
+
"nacos-sdk-rust-binding-node-linux-arm64-musl": "0.1.0",
|
|
65
|
+
"nacos-sdk-rust-binding-node-win32-arm64-msvc": "0.1.0",
|
|
66
|
+
"nacos-sdk-rust-binding-node-linux-arm-gnueabihf": "0.1.0",
|
|
67
|
+
"nacos-sdk-rust-binding-node-linux-x64-musl": "0.1.0",
|
|
68
|
+
"nacos-sdk-rust-binding-node-freebsd-x64": "0.1.0",
|
|
69
|
+
"nacos-sdk-rust-binding-node-win32-ia32-msvc": "0.1.0",
|
|
70
|
+
"nacos-sdk-rust-binding-node-android-arm-eabi": "0.1.0",
|
|
71
|
+
"nacos-sdk-rust-binding-node-darwin-universal": "0.1.0"
|
|
72
72
|
}
|
|
73
73
|
}
|
package/src/config.rs
CHANGED
|
@@ -51,9 +51,9 @@ impl NacosConfigClient {
|
|
|
51
51
|
nacos_sdk::api::config::ConfigServiceBuilder::new(props)
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
let config_service_builder = if
|
|
54
|
+
let config_service_builder = if let Some(filter) = config_filter {
|
|
55
55
|
config_service_builder.add_config_filter(Box::new(crate::NacosConfigFilter {
|
|
56
|
-
func: Arc::new(
|
|
56
|
+
func: Arc::new(filter),
|
|
57
57
|
}))
|
|
58
58
|
} else {
|
|
59
59
|
config_service_builder
|
package/src/lib.rs
CHANGED
|
@@ -20,10 +20,8 @@ lazy_static::lazy_static! {
|
|
|
20
20
|
tracing_subscriber::fmt()
|
|
21
21
|
.with_writer(non_blocking)
|
|
22
22
|
.with_timer(tracing_subscriber::fmt::time::LocalTime::rfc_3339())
|
|
23
|
-
.with_level(true)
|
|
24
23
|
.with_thread_names(true)
|
|
25
24
|
.with_thread_ids(true)
|
|
26
|
-
.with_line_number(true)
|
|
27
25
|
.with_max_level(tracing_subscriber::filter::LevelFilter::INFO)
|
|
28
26
|
.init();
|
|
29
27
|
|