nacos-sdk-rust-binding-node 0.1.0-PRE → 0.1.0-PRE2
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 +1 -1
- package/index.d.ts +12 -0
- package/package.json +15 -15
- package/src/config.rs +13 -0
- package/src/lib.rs +1 -0
- package/src/naming.rs +14 -0
package/Cargo.toml
CHANGED
|
@@ -21,7 +21,7 @@ napi-derive = "2"
|
|
|
21
21
|
#nacos-sdk = { version = "0.2.3", features = ["async"] }
|
|
22
22
|
nacos-sdk = { git = "https://github.com/nacos-group/nacos-sdk-rust.git", features = ["async"] }
|
|
23
23
|
|
|
24
|
-
tracing-subscriber = "0.3"
|
|
24
|
+
tracing-subscriber = { version = "0.3", features = ["env-filter", "local-time"] }
|
|
25
25
|
tracing-appender = "0.2"
|
|
26
26
|
lazy_static = "1.4.0"
|
|
27
27
|
|
package/index.d.ts
CHANGED
|
@@ -107,6 +107,12 @@ export class NacosConfigClient {
|
|
|
107
107
|
* If it fails, pay attention to err
|
|
108
108
|
*/
|
|
109
109
|
addListener(dataId: string, group: string, listener: (err: Error | null, value: NacosConfigResponse) => any): Promise<void>
|
|
110
|
+
/**
|
|
111
|
+
* Remove NacosConfigChangeListener callback func, but noop....
|
|
112
|
+
* The logic is not implemented internally, and only APIs are provided as compatibility.
|
|
113
|
+
* Users maybe do not need it? Not removing the listener is not a big problem, Sorry!
|
|
114
|
+
*/
|
|
115
|
+
removeListener(dataId: string, group: string, listener: (err: Error | null, value: NacosConfigResponse) => any): Promise<void>
|
|
110
116
|
}
|
|
111
117
|
/** Client api of Nacos Naming. */
|
|
112
118
|
export class NacosNamingClient {
|
|
@@ -147,4 +153,10 @@ export class NacosNamingClient {
|
|
|
147
153
|
* If it fails, pay attention to err
|
|
148
154
|
*/
|
|
149
155
|
subscribe(serviceName: string, group: string, clusters: Array<string> | undefined | null, listener: (err: Error | null, value: Array<NacosServiceInstance>) => any): Promise<void>
|
|
156
|
+
/**
|
|
157
|
+
* Remove NacosNamingEventListener callback func, but noop....
|
|
158
|
+
* The logic is not implemented internally, and only APIs are provided as compatibility.
|
|
159
|
+
* Users maybe do not need it? Not removing the subscription is not a big problem, Sorry!
|
|
160
|
+
*/
|
|
161
|
+
unSubscribe(serviceName: string, group: string, clusters: Array<string> | undefined | null, listener: (err: Error | null, value: Array<NacosServiceInstance>) => any): Promise<void>
|
|
150
162
|
}
|
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-PRE2",
|
|
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-PRE2",
|
|
59
|
+
"nacos-sdk-rust-binding-node-darwin-x64": "0.1.0-PRE2",
|
|
60
|
+
"nacos-sdk-rust-binding-node-linux-x64-gnu": "0.1.0-PRE2",
|
|
61
|
+
"nacos-sdk-rust-binding-node-darwin-arm64": "0.1.0-PRE2",
|
|
62
|
+
"nacos-sdk-rust-binding-node-android-arm64": "0.1.0-PRE2",
|
|
63
|
+
"nacos-sdk-rust-binding-node-linux-arm64-gnu": "0.1.0-PRE2",
|
|
64
|
+
"nacos-sdk-rust-binding-node-linux-arm64-musl": "0.1.0-PRE2",
|
|
65
|
+
"nacos-sdk-rust-binding-node-win32-arm64-msvc": "0.1.0-PRE2",
|
|
66
|
+
"nacos-sdk-rust-binding-node-linux-arm-gnueabihf": "0.1.0-PRE2",
|
|
67
|
+
"nacos-sdk-rust-binding-node-linux-x64-musl": "0.1.0-PRE2",
|
|
68
|
+
"nacos-sdk-rust-binding-node-freebsd-x64": "0.1.0-PRE2",
|
|
69
|
+
"nacos-sdk-rust-binding-node-win32-ia32-msvc": "0.1.0-PRE2",
|
|
70
|
+
"nacos-sdk-rust-binding-node-android-arm-eabi": "0.1.0-PRE2",
|
|
71
|
+
"nacos-sdk-rust-binding-node-darwin-universal": "0.1.0-PRE2"
|
|
72
72
|
}
|
|
73
73
|
}
|
package/src/config.rs
CHANGED
|
@@ -141,6 +141,19 @@ impl NacosConfigClient {
|
|
|
141
141
|
.map_err(|nacos_err| Error::from_reason(nacos_err.to_string()))?;
|
|
142
142
|
Ok(())
|
|
143
143
|
}
|
|
144
|
+
|
|
145
|
+
/// Remove NacosConfigChangeListener callback func, but noop....
|
|
146
|
+
/// The logic is not implemented internally, and only APIs are provided as compatibility.
|
|
147
|
+
/// Users maybe do not need it? Not removing the listener is not a big problem, Sorry!
|
|
148
|
+
#[napi]
|
|
149
|
+
pub async fn remove_listener(
|
|
150
|
+
&self,
|
|
151
|
+
_data_id: String,
|
|
152
|
+
_group: String,
|
|
153
|
+
_listener: ThreadsafeFunction<NacosConfigResponse>,
|
|
154
|
+
) -> Result<()> {
|
|
155
|
+
Ok(())
|
|
156
|
+
}
|
|
144
157
|
}
|
|
145
158
|
|
|
146
159
|
#[napi(object)]
|
package/src/lib.rs
CHANGED
package/src/naming.rs
CHANGED
|
@@ -221,6 +221,20 @@ impl NacosNamingClient {
|
|
|
221
221
|
.map_err(|nacos_err| Error::from_reason(nacos_err.to_string()))?;
|
|
222
222
|
Ok(())
|
|
223
223
|
}
|
|
224
|
+
|
|
225
|
+
/// Remove NacosNamingEventListener callback func, but noop....
|
|
226
|
+
/// The logic is not implemented internally, and only APIs are provided as compatibility.
|
|
227
|
+
/// Users maybe do not need it? Not removing the subscription is not a big problem, Sorry!
|
|
228
|
+
#[napi]
|
|
229
|
+
pub async fn un_subscribe(
|
|
230
|
+
&self,
|
|
231
|
+
_service_name: String,
|
|
232
|
+
_group: String,
|
|
233
|
+
_clusters: Option<Vec<String>>,
|
|
234
|
+
_listener: ThreadsafeFunction<Vec<NacosServiceInstance>>,
|
|
235
|
+
) -> Result<()> {
|
|
236
|
+
Ok(())
|
|
237
|
+
}
|
|
224
238
|
}
|
|
225
239
|
|
|
226
240
|
pub struct NacosNamingEventListener {
|