-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.js
More file actions
36 lines (30 loc) · 970 Bytes
/
index.js
File metadata and controls
36 lines (30 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env node
"use strict";
/**
* Node.js : constellation-nodejs
* Constellation context access from nodejs.
*
**/
var ConstellationContext = require('./lib/constellation.js');
var ConstellationFactory = function(url, accessKey, applicationName, sdkVersion) {
var ctx = new ConstellationContext();
this.Sentinel = function(sentinelName) {
return ctx.init(url, accessKey, applicationName, sdkVersion)
.then(() => {
return ctx.getPackageHub(sentinelName);
});
}
this.Controller = function() {
return ctx.init(url, accessKey, applicationName, sdkVersion)
.then(() => {
return ctx.getControllerHub();
});
}
this.Consumer = function() {
return ctx.init(url, accessKey, applicationName, sdkVersion)
.then(() => {
return ctx.getConsumerHub();
});
}
}
module.exports = ConstellationFactory;