mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
b912768923
* feat: move secrets to settings * feat: Add better support for detailed db options. Added db field in options to allow better control of db-options. Especially important to allow special chars in database password which might lead to an invaid url when defined as a database-url. * fix: integrate logger with knex logger * fix: remove secret option from all examples * fix: more options.js unit tests * fix: added settings-store e2e tests
45 lines
1.6 KiB
JavaScript
45 lines
1.6 KiB
JavaScript
'use strict';
|
|
|
|
const { createDb } = require('./db-pool');
|
|
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');
|
|
const ClientMetricsStore = require('./client-metrics-store');
|
|
const ClientApplicationsStore = require('./client-applications-store');
|
|
const ContextFieldStore = require('./context-field-store');
|
|
const SettingStore = require('./setting-store');
|
|
|
|
module.exports.createStores = (config, eventBus) => {
|
|
const getLogger = config.getLogger;
|
|
const db = createDb(config);
|
|
const eventStore = new EventStore(db, getLogger);
|
|
const clientMetricsDb = new ClientMetricsDb(db, getLogger);
|
|
|
|
return {
|
|
db,
|
|
eventStore,
|
|
featureToggleStore: new FeatureToggleStore(db, eventStore, getLogger),
|
|
strategyStore: new StrategyStore(db, eventStore, getLogger),
|
|
clientApplicationsStore: new ClientApplicationsStore(
|
|
db,
|
|
eventBus,
|
|
getLogger
|
|
),
|
|
clientInstanceStore: new ClientInstanceStore(db, eventBus, getLogger),
|
|
clientMetricsStore: new ClientMetricsStore(
|
|
clientMetricsDb,
|
|
eventBus,
|
|
getLogger
|
|
),
|
|
contextFieldStore: new ContextFieldStore(
|
|
db,
|
|
config.customContextFields,
|
|
eventStore,
|
|
getLogger
|
|
),
|
|
settingStore: new SettingStore(db, getLogger),
|
|
};
|
|
};
|