https://github.com/vicanso/consul-client
consul client
https://github.com/vicanso/consul-client
Last synced: 8 months ago
JSON representation
consul client
- Host: GitHub
- URL: https://github.com/vicanso/consul-client
- Owner: vicanso
- Created: 2015-09-13T02:57:20.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-28T13:02:49.000Z (about 10 years ago)
- Last Synced: 2024-04-09T22:28:26.768Z (over 1 year ago)
- Language: JavaScript
- Size: 145 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
simple consul clinet
## constructor
### 构建函数```js
let client = new Client({
host: '127.0.0.1',
port: 8500
});
```## register
### 注册服务```js
yield client.register({
id: '730d03591ba2',
service: 'albi',
address: '172.17.0.1',
port: 80,
tags: ['http-backend', 'prefix:/albi', 'http-ping']
});
```## deregister
### 注销服务```js
yield client.deregister('730d03591ba2');
```## list
### 列出某服务的所有节点信息```js
yield client.list('albi');
```## listByTags
### 列出包含某种tag的节点信息```js
yield client.listByTags(['http-ping']);
```