0.2.1 • Published 7 years ago

gfg-nodejs-libary-service-discovery v0.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Dynamo Discovery Service

Discovery service like etcd but implemented with DynamoDB

Installation (not yet available)

$ npm install --save gfg-nodejs-libary-service-discovery

Introduction

The idea is to use DynamoDB to keep track of the services. The downside is the extra code you have to write for each service. This repo will try to tackle that.

Forked from: https://github.com/SamVerschueren/dynamo-discovery-service

The table hosted on Dynamo DB is: services Primary key: AppName Sort key: ServiceName

Usage

Connecting with DynamoDB

var servicediscovery = require('servicediscovery');

// Connect with DynamoDB via the access keys
servicediscovery.connect({
    accessKeyId: 'myAccessKey',
    secretAccessKey: 'mySecretAccessKey',
    region: 'ap-southeast-1'
});

Retrieving a service

By only providing the name of the service, you will retrieve the end point for the service.

// Retrieve the latest serviceA service for the app: pricing-engine
dds.get('pricing-engine', 'serviceA').then(function(mongo) {
    // Connect with the serviceA service
}).catch(function(err) {
    // Handle error
});

The return value should be

{
  ServiceName: 'serviceA',
  Prod: {
    endpoint: 'http://www.prodserviceA.com',
    type: 'http'
  },
  UAT: {
    endpoint: 'http://www.uatserviceA.com',
    type: 'http'
  },
  AppName: 'pricing-engine'
}

License

MIT © Sam Verschueren

0.2.1

7 years ago

0.2.0

7 years ago

0.1.13

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago