RackHD/on-core

View on GitHub
lib/workflow/stores/store.js

Summary

Maintainability
A
1 hr
Test Coverage
// Copyright 2015, EMC, Inc.
'use strict';

module.exports = storeFactory;
storeFactory.$provide = 'TaskGraph.Store';
storeFactory.$inject = [
    'Services.Configuration',
    '$injector'
];

function storeFactory(configuration, injector) {
    var mode = configuration.get('taskgraph-store', 'mongo');
    switch(mode) {
        case 'mongo':
            return injector.get('TaskGraph.Stores.Mongo');
        default:
            throw new Error('Unknown taskgraph store: ' + mode);
    }
}