1.2.4 • Published 6 years ago
@youpenglai/mfw v1.2.4
Consul
朋来私有 client.
Documentation
registry(options)
Initialize a new Consul client.
Options
- port (required Integer): agent HTTP(S) port
Usage
const Registry = require('@penglai/mfw').Registry;
Registry.register({
port: 3500,
name: 'web11',
check: {
type: 'http or grpc'
}
})
==> promise
Registry.discover(serviceName)
server
const Server = require('@penglai/mfw').Server;
Server.add([{
protoPath: '文件路径,绝对路径',
package: '包名',
serviceName: '方法名',
methods: {
fnName: handle
},
}]);
Server.bind('0.0.0.0:50011');
Server.start();
client
const Client = require('@penglai/mfw').Client;
const client = Client.create({
ipAddress: 'localhost:60061',
protoPath: '文件路径',
package: '包名',
serviceName: '方法名'
})
client.check()
.then(() => {
})
.catch(() => {
})
1.2.4
6 years ago
1.2.3
6 years ago
1.2.2
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.1.5
6 years ago
1.1.4
6 years ago
1.1.3
6 years ago
1.1.2
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.9
6 years ago
1.0.8
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago