UNPKG

@tmlmobilidade/interfaces

Version:

This package provides SDK-style connectors for interacting with databases (e.g., stops, plans, rides, alerts) and external providers (e.g., authentication, storage). It simplifies data access and integration across projects.

20 lines (19 loc) 596 B
/* * */ import { OCIStorageProvider } from './oci-storage.js'; /* * */ export class StorageFactory { /** * Creates and returns an instance of a storage service based on the provided configuration. * * @param config - The storage configuration object. * @returns An instance of a class that implements IStorageProvider. */ static create(config) { switch (config.type) { case 'oci': return new OCIStorageProvider(config.oci_config); default: throw new Error(`Invalid storage type`); } } }