1.2.4 • Published 5 years ago

@youpenglai/mfw v1.2.4

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

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

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago