Members
ServiceSDK constructor
Type:
function
Constructor
- services
- Type:
Object - <serviceName>
- Type:
Object index name = name of the service
- <scope>
- Type:
Object index name not constrained, could be anything... eg.: specific service application name (in case multiple applications are listening under one service) or access level type eg.: "public" or "s2s"
- npm
- Type:
String npm sdk package name which exports a literal object of versioned ServiceSDKs. (use either
diror `npm option)- dir
- Type:
String sdk package directory path which exports object that inherits ServiceSDK. (use either
diror `npm option)- host
- Type:
String - protocol
- Type:
Boolean
A factory for ServiceSDK instances
(see affiliated serviser-sdk plugin)
and SDKs integration
Parameters:
Methods
- key
- Type:
String format
<serviceName>:<scope>- sdk
- Type:
ServiceSDK - self
- key
- Type:
String format:
<serviceName>:<scope>:<version>- options optional
- Type:
Object ServiceSDKconstructor options-
Error - key
- Type:
String format
<serviceName>:<scope>:<version>- key
- Type:
String format
<serviceName>:<scope>:<version>(scope|version key segments are optional)
RemoteServiceManager
registers ServiceSDK instance
Parameters:
RemoteServiceManager
ServiceSDK
constructs specific ServiceSDK from configuration provided to the constructor
the specific ServiceSDK is supposed to be auto generated by serviser-sdk plugin
and published as a npm package
Parameters:
Throws:
ServiceSDK
Example:
//config.js:
module.exports = {
services: {
user: {
public: {
protocol: 'https',
host: "127.0.0.1:4001",
npm: "service-name-app-name-sdk"
}
}
}
}
or
module.exports = {
services: {
user: {
public: {
protocol: 'https',
host: "127.0.0.1:4001",
dir: "/absolute/path/to/my/sdk/directory"
}
}
}
}
//method usage
remoteServiceManager.buildRemoteService('user:public:v1.0');
ServiceSDK
Parameters:
ServiceSDK
Boolean
Parameters:
Boolean