1.10.6 • Published 2 years ago

@qiwi/consul-service-discovery v1.10.6

Weekly downloads
4
License
MIT
Repository
github
Last release
2 years 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

2 years ago

1.10.5

2 years ago

1.10.4

3 years ago

1.10.3

3 years ago

1.10.2

3 years ago

1.10.1

3 years ago

1.10.0

4 years ago

1.9.6

4 years ago

1.9.5

4 years ago

1.9.4

4 years ago

1.9.3

5 years ago

1.9.2

5 years ago

1.9.1

5 years ago

1.9.0

5 years ago

1.8.2

5 years ago

1.8.1

5 years ago

1.8.0

5 years ago

1.7.7

5 years ago

1.7.6

5 years ago

1.7.5

5 years ago

1.7.4

5 years ago

1.7.3

5 years ago

1.7.2

5 years ago

1.7.1

5 years ago

1.7.0

6 years ago

1.6.1

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago