init
This commit is contained in:
17
app/storage/factory.py
Normal file
17
app/storage/factory.py
Normal file
@@ -0,0 +1,17 @@
|
||||
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}")
|
||||
Reference in New Issue
Block a user