s3-service-registry

use s3 to publish the hosts and ports of running services

s3-service-registry

use s3 to publish the hosts and ports of running services

var s3reg = require('s3-service-registry')
 
var reg = s3reg(s3key,s3secret,bucket);
 
reg.online(function(err,list){
  console.log('online services',list)
 
});
 

lists returned will be arrays of objects like. by default a tcp check is run on the host and port but you can pass in a custom check.

 [ { Key: 'hi-1797733be60f08e46ee2c6a0bb41d67d5295607d-127.0.0.1-1337',
    LastModified: Tue Feb 18 2014 16:45:29 GMT-0800 (PST),
    ETag: '"4891f51750205e2380566db567bcd7d7"',
    Size: 71,
    Owner: 
     { ID: '--------',
       DisplayName: '---------' },
    StorageClass: 'STANDARD',
    service: 'hi',
    id: '-------',
    host: '127.0.0.1',
    port: '1337',
    listening: false,
    offline: true } ]
 

##API

ctor = require('s3-service-registry')
instance = ctor(s3key,s3secret,bucket)

register(service)

  • service (optional) prefix serce in bucket for service
  • check(info,cb) (optional) run this check instead of the default tcpCheck
  • cb callback
  • service (optional) prefix serce in bucket for service
  • check(info,cb) (optional) run this check instead of the default tcpCheck
  • cb callback
  • service (optional) prefix serce in bucket for service
  • check(info,cb) (optional) run this check instead of the default tcpCheck
  • cb callback
  • key the s3 name of the file. the value of Key in list objects
  • service (optional) prefix serce in bucket for service

delete registered services by name.