1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/lib/db/index.js

28 lines
1.1 KiB
JavaScript
Raw Normal View History

2016-11-04 09:03:13 +01:00
'use strict';
2016-11-04 09:35:53 +01:00
const { createDb } = require('./db-pool');
2016-11-05 10:16:48 +01:00
const EventStore = require('./event-store');
const FeatureToggleStore = require('./feature-toggle-store');
const StrategyStore = require('./strategy-store');
const ClientInstanceStore = require('./client-instance-store');
const ClientMetricsDb = require('./client-metrics-db');
2016-11-05 13:36:44 +01:00
const ClientMetricsStore = require('./client-metrics-store');
2016-12-06 09:19:15 +01:00
const ClientApplicationsStore = require('./client-applications-store');
2016-11-04 09:03:13 +01:00
2017-06-28 10:17:14 +02:00
module.exports.createStores = config => {
const getLogger = config.getLogger;
2016-11-13 15:15:33 +01:00
const db = createDb(config);
const eventStore = new EventStore(db, getLogger);
const clientMetricsDb = new ClientMetricsDb(db, getLogger);
2016-11-05 10:16:48 +01:00
return {
db,
2016-11-05 10:16:48 +01:00
eventStore,
featureToggleStore: new FeatureToggleStore(db, eventStore, getLogger),
strategyStore: new StrategyStore(db, eventStore, getLogger),
clientApplicationsStore: new ClientApplicationsStore(db, getLogger),
clientInstanceStore: new ClientInstanceStore(db, getLogger),
clientMetricsStore: new ClientMetricsStore(clientMetricsDb, getLogger),
2016-11-05 10:16:48 +01:00
};
};