1.10.6 • Published 11 months ago

@qiwi/consul-service-discovery v1.10.6

Weekly downloads
4
License
MIT
Repository
github
Last release
11 months ago

Consul service discovery

CI npm (tag) Maintainability Test Coverage CodeStyle

Consul service discovery helper.

Install

  npm i @qiwi/consul-service-discovery
  yarn add @qiwi/consul-service-discovery

Usage

import ConsulServiceDiscovery from '@qiwi/consul-service-discovery'

const discovery = new ConsulServiceDiscovery({
  host: '0.0.0.0',  // local consul client host
  port: 8000        // and port
})
const targetServiceName = 'example-api' // registered service
const serviceConnectionParams = await discovery.getConnectionParams(targetServiceName)

console.log(serviceConnectionParams) // { host: example-api-1234.qiwi.com, post: 8000 }

Configure

You may override some inner lib deps like logger (console by default) or Promise implementations:

ConsulServiceDiscovery.configure({
  Promise,  // Bluebird
  logger,   // log4js
  Consul    // consul client factory
})

License

MIT

1.10.6

11 months ago

1.10.5

1 year ago

1.10.4

1 year ago

1.10.3

1 year ago

1.10.2

2 years ago

1.10.1

2 years ago

1.10.0

3 years ago

1.9.6

3 years ago

1.9.5

3 years ago

1.9.4

3 years ago

1.9.3

3 years ago

1.9.2

4 years ago

1.9.1

4 years ago

1.9.0

4 years ago

1.8.2

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.7.7

4 years ago

1.7.6

4 years ago

1.7.5

4 years ago

1.7.4

4 years ago

1.7.3

4 years ago

1.7.2

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.1

5 years ago

1.3.0

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

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago