Constructor
A Resource can be any object that implements inspectIntegrity method which
must return a Promise.
Methods
- key
- Type:
String - resource
- Type:
Object - key
- Type:
String resource key as provided to
ResourceManager#register- tag optional
- Type:
String - Default:
'*' identifies a span of resources which will be inspected
- options optional
- Type:
Object - mode optional
- Type:
String - Default:
'include' include | exclude
- key
- Type:
String resource identifier
- resource
- Type:
Object -
TypeError - resource object
- key
- Type:
String resource key as provided to
ResourceManager#register- key
- Type:
String resource key as provided to
ResourceManager#register- tag repeatable
- Type:
String
Object
Parameters:
Object
resource object
Object
Parameters:
Object
resource object
Boolean
Promise
inspects integrity of a group of registered resources.
Groups are recognized via resource tags. if no group is provided, all resources
will be inspected.
This method operates in two modes include/exclude - where include mode
inspects a provided resource group (tag) as opposed to exclude which
inspects all resources which are NOT assigned provided tag.
Parameters:
Promise
Example:
resourceManager.register('mysql', mysqlAdapter);
resourceManager.register('postgres', postgresAdapter);
resourceManager.register('rabbit', amqpAdapter);
resourceManager.tag('postgres', 'database');
resourceManager.tag('mysql', 'database');
return resourceManager.inspectIntegrity('database'); //inspects only mysql & postgres
Object
The resource is given default tag which is equal to the resource key.
Parameters:
Throws:
Object
Object or undefined
Parameters:
Object or undefined
removed resource object or undefined when nothing was removed
undefined
assigns tag(s) to a resource. Tags meet the role of groups of resources.
You can use a tag instead of a resource key to identify and target a span of resources.
Parameters:
undefined