UNPKG

memory-card

Version:

ES6 Map like Async API, with Swagger API Backend Support.

40 lines 1.12 kB
import { StorageFile } from './file.js'; import { StorageNop } from './nop.js'; async function obsLoader() { try { const m = await import('./obs.js'); return m.default; } catch (e) { console.error(e); throw new Error('Load OBS Storage failed: have you installed the "esdk-obs-nodejs" NPM module?'); } } async function s3Loader() { try { const m = await import('./s3.js'); return m.default; } catch (e) { console.error(e); throw new Error('Load S3 Storage failed: have you installed the "aws-sdk" NPM module?'); } } async function etcdLoader() { try { const m = await import('./etcd.js'); return m.default; } catch (e) { console.error(e); throw new Error('Load Etcd Storage failed: have you installed the "etcd3" NPM module?'); } } export const BACKEND_FACTORY_DICT = { etcd: etcdLoader, file: async () => Promise.resolve(StorageFile), nop: async () => Promise.resolve(StorageNop), obs: obsLoader, s3: s3Loader, }; //# sourceMappingURL=backend-config.js.map