mirror of
https://github.com/sofastack/sofa-rpc-node.git
synced 2026-01-18 15:55:54 +00:00
34 lines
644 B
JavaScript
34 lines
644 B
JavaScript
'use strict';
|
|
|
|
const APIClientBase = require('cluster-client').APIClientBase;
|
|
|
|
class RegistryBase extends APIClientBase {
|
|
get clusterOptions() {
|
|
return {
|
|
name: `SofaRpcRegistry@${this.options.address}`,
|
|
};
|
|
}
|
|
|
|
async register(config) {
|
|
return await this._client.register(config);
|
|
}
|
|
|
|
async unRegister(config) {
|
|
return await this._client.unRegister(config);
|
|
}
|
|
|
|
subscribe(config, listener) {
|
|
this._client.subscribe(config, listener);
|
|
}
|
|
|
|
unSubscribe(config, listener) {
|
|
this._client.unSubscribe(config, listener);
|
|
}
|
|
|
|
close() {
|
|
return this._client.close();
|
|
}
|
|
}
|
|
|
|
module.exports = RegistryBase;
|