antfin-sofa-node-antvip

1.0.0 • Public • Published

antfin-sofa-node-antvip

金融云 antvip 客户端

安装

$ tnpm install antfin-sofa-node-antvip --save

配置

'use strict';
 
const os = require('os');
 
exports.antvip = {
  endpoint: '10.xx.xx.xx',
  cacheDir: path.join(os.homedir(), 'conf/antvip-node-client-cache'),
};

用法

app.antvip.subscribe('xxxxxxxxx-DSR_CLOUD', domain => {
  // ...
});
 
const server = yield app.antvip.getRealServer('xxxxxxxxx-ProductName');
console.log(server);

API

* getRealServer(domainName)

根据域名,从候选的 RealServer 列表中,按照负载均衡(带 weight 的 RoundRobin )的方式,返回 RealServer。

* getRealServers(domainName)

根据域名,返回健康状态属于可用的 RealServer 列表。

* getAllRealServers(domainName)

根据域名,返回所有的(无论健康状态属于可用的还是不可用) RealServer 列表

Readme

Keywords

Package Sidebar

Install

npm i antfin-sofa-node-antvip

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

20.8 kB

Total Files

8

Last publish

Collaborators

  • kangpangpang