18 lines
561 B
Python
18 lines
561 B
Python
from app.storage.base import StorageBackend
|
|
from app.storage.s3_backend import S3Backend
|
|
from app.storage.minio_backend import MinIOBackend
|
|
from app.config import settings
|
|
|
|
|
|
def get_storage_backend() -> StorageBackend:
|
|
"""
|
|
Factory function to get the appropriate storage backend
|
|
based on configuration
|
|
"""
|
|
if settings.storage_backend == "s3":
|
|
return S3Backend()
|
|
elif settings.storage_backend == "minio":
|
|
return MinIOBackend()
|
|
else:
|
|
raise ValueError(f"Unsupported storage backend: {settings.storage_backend}")
|