nacos-sdk-rust-binding-node 0.3.5 → 0.3.6
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 +2 -2
- package/example/config.js +2 -0
- package/example/config_decrypt.js +2 -0
- package/example/naming.js +2 -0
- package/index.d.ts +4 -4
- package/package.json +15 -15
- package/tea.yaml +7 -0
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.3.
|
|
4
|
+
version = "0.3.6"
|
|
5
5
|
authors = ["CheirshCai <785427346@qq.com>"]
|
|
6
6
|
license = "Apache-2.0"
|
|
7
7
|
readme = "README.md"
|
|
@@ -18,7 +18,7 @@ crate-type = ["cdylib"]
|
|
|
18
18
|
napi = { version = "2", default-features = false, features = ["napi4", "async"] }
|
|
19
19
|
napi-derive = "2"
|
|
20
20
|
|
|
21
|
-
nacos-sdk = { version = "0.3.
|
|
21
|
+
nacos-sdk = { version = "0.3.6", features = ["async"] }
|
|
22
22
|
#nacos-sdk = { git = "https://github.com/nacos-group/nacos-sdk-rust.git", branch = "main", features = ["async"] }
|
|
23
23
|
|
|
24
24
|
tracing-subscriber = { version = "0.3", features = ["default"] }
|
package/example/config.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
const { NacosConfigClient, NacosConfigResponse } = require('../index')
|
|
4
4
|
|
|
5
5
|
// If it fails, pay attention to err
|
|
6
|
+
// 请注意!一般情况下,应用下仅需一个 Config 客户端,而且需要长期持有直至应用停止。
|
|
7
|
+
// 因为它内部会初始化与服务端的长链接,后续的数据交互及变更订阅,都是实时地通过长链接告知客户端的。
|
|
6
8
|
const nacos_config_client = new NacosConfigClient({
|
|
7
9
|
serverAddr: '0.0.0.0:8848',
|
|
8
10
|
namespace: "hongwen",
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
const { NacosConfigClient, NacosConfigResponse } = require('../index')
|
|
4
4
|
|
|
5
5
|
// If it fails, pay attention to err
|
|
6
|
+
// 请注意!一般情况下,应用下仅需一个 Config 客户端,而且需要长期持有直至应用停止。
|
|
7
|
+
// 因为它内部会初始化与服务端的长链接,后续的数据交互及变更订阅,都是实时地通过长链接告知客户端的。
|
|
6
8
|
const nacos_config_client = new NacosConfigClient(
|
|
7
9
|
{
|
|
8
10
|
serverAddr: '127.0.0.1:8848',
|
package/example/naming.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
const { NacosNamingClient, NacosServiceInstance } = require('../index')
|
|
4
4
|
|
|
5
5
|
// If it fails, pay attention to err
|
|
6
|
+
// 请注意!一般情况下,应用下仅需一个 Naming 客户端,而且需要长期持有直至应用停止。
|
|
7
|
+
// 因为它内部会初始化与服务端的长链接,后续的数据交互及变更订阅,都是实时地通过长链接告知客户端的。
|
|
6
8
|
const nacos_naming_client = new NacosNamingClient({
|
|
7
9
|
serverAddr: '0.0.0.0:8848',
|
|
8
10
|
namespace: "hongwen",
|
package/index.d.ts
CHANGED
|
@@ -110,13 +110,13 @@ export class NacosConfigClient {
|
|
|
110
110
|
* Add NacosConfigChangeListener callback func, which listen the config change.
|
|
111
111
|
* If it fails, pay attention to err
|
|
112
112
|
*/
|
|
113
|
-
addListener(dataId: string, group: string, listener: (err: Error | null,
|
|
113
|
+
addListener(dataId: string, group: string, listener: (err: Error | null, arg: NacosConfigResponse) => any): Promise<void>
|
|
114
114
|
/**
|
|
115
115
|
* Remove NacosConfigChangeListener callback func, but noop....
|
|
116
116
|
* The logic is not implemented internally, and only APIs are provided as compatibility.
|
|
117
117
|
* Users maybe do not need it? Not removing the listener is not a big problem, Sorry!
|
|
118
118
|
*/
|
|
119
|
-
removeListener(dataId: string, group: string, listener: (err: Error | null,
|
|
119
|
+
removeListener(dataId: string, group: string, listener: (err: Error | null, arg: NacosConfigResponse) => any): Promise<void>
|
|
120
120
|
}
|
|
121
121
|
/** Client api of Nacos Naming. */
|
|
122
122
|
export class NacosNamingClient {
|
|
@@ -156,11 +156,11 @@ export class NacosNamingClient {
|
|
|
156
156
|
* Add NacosNamingEventListener callback func, which listen the instance change.
|
|
157
157
|
* If it fails, pay attention to err
|
|
158
158
|
*/
|
|
159
|
-
subscribe(serviceName: string, group: string, clusters: Array<string> | undefined | null, listener: (err: Error | null,
|
|
159
|
+
subscribe(serviceName: string, group: string, clusters: Array<string> | undefined | null, listener: (err: Error | null, arg: Array<NacosServiceInstance>) => any): Promise<void>
|
|
160
160
|
/**
|
|
161
161
|
* Remove NacosNamingEventListener callback func, but noop....
|
|
162
162
|
* The logic is not implemented internally, and only APIs are provided as compatibility.
|
|
163
163
|
* Users maybe do not need it? Not removing the subscription is not a big problem, Sorry!
|
|
164
164
|
*/
|
|
165
|
-
unSubscribe(serviceName: string, group: string, clusters: Array<string> | undefined | null, listener: (err: Error | null,
|
|
165
|
+
unSubscribe(serviceName: string, group: string, clusters: Array<string> | undefined | null, listener: (err: Error | null, arg: Array<NacosServiceInstance>) => any): Promise<void>
|
|
166
166
|
}
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"binding",
|
|
8
8
|
"ffi"
|
|
9
9
|
],
|
|
10
|
-
"version": "0.3.
|
|
10
|
+
"version": "0.3.6",
|
|
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.3.
|
|
59
|
-
"nacos-sdk-rust-binding-node-darwin-x64": "0.3.
|
|
60
|
-
"nacos-sdk-rust-binding-node-linux-x64-gnu": "0.3.
|
|
61
|
-
"nacos-sdk-rust-binding-node-darwin-arm64": "0.3.
|
|
62
|
-
"nacos-sdk-rust-binding-node-android-arm64": "0.3.
|
|
63
|
-
"nacos-sdk-rust-binding-node-linux-arm64-gnu": "0.3.
|
|
64
|
-
"nacos-sdk-rust-binding-node-linux-arm64-musl": "0.3.
|
|
65
|
-
"nacos-sdk-rust-binding-node-win32-arm64-msvc": "0.3.
|
|
66
|
-
"nacos-sdk-rust-binding-node-linux-arm-gnueabihf": "0.3.
|
|
67
|
-
"nacos-sdk-rust-binding-node-linux-x64-musl": "0.3.
|
|
68
|
-
"nacos-sdk-rust-binding-node-freebsd-x64": "0.3.
|
|
69
|
-
"nacos-sdk-rust-binding-node-win32-ia32-msvc": "0.3.
|
|
70
|
-
"nacos-sdk-rust-binding-node-android-arm-eabi": "0.3.
|
|
71
|
-
"nacos-sdk-rust-binding-node-darwin-universal": "0.3.
|
|
58
|
+
"nacos-sdk-rust-binding-node-win32-x64-msvc": "0.3.6",
|
|
59
|
+
"nacos-sdk-rust-binding-node-darwin-x64": "0.3.6",
|
|
60
|
+
"nacos-sdk-rust-binding-node-linux-x64-gnu": "0.3.6",
|
|
61
|
+
"nacos-sdk-rust-binding-node-darwin-arm64": "0.3.6",
|
|
62
|
+
"nacos-sdk-rust-binding-node-android-arm64": "0.3.6",
|
|
63
|
+
"nacos-sdk-rust-binding-node-linux-arm64-gnu": "0.3.6",
|
|
64
|
+
"nacos-sdk-rust-binding-node-linux-arm64-musl": "0.3.6",
|
|
65
|
+
"nacos-sdk-rust-binding-node-win32-arm64-msvc": "0.3.6",
|
|
66
|
+
"nacos-sdk-rust-binding-node-linux-arm-gnueabihf": "0.3.6",
|
|
67
|
+
"nacos-sdk-rust-binding-node-linux-x64-musl": "0.3.6",
|
|
68
|
+
"nacos-sdk-rust-binding-node-freebsd-x64": "0.3.6",
|
|
69
|
+
"nacos-sdk-rust-binding-node-win32-ia32-msvc": "0.3.6",
|
|
70
|
+
"nacos-sdk-rust-binding-node-android-arm-eabi": "0.3.6",
|
|
71
|
+
"nacos-sdk-rust-binding-node-darwin-universal": "0.3.6"
|
|
72
72
|
}
|
|
73
73
|
}
|