feat: local storage logic & endpoints
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
"""File storage provider — singleton factory."""
|
||||
|
||||
from app.core.config import get_settings
|
||||
from app.infrastructure.storage.local import LocalFileStorage
|
||||
|
||||
_storage: LocalFileStorage | None = None
|
||||
|
||||
|
||||
def get_file_storage() -> LocalFileStorage:
|
||||
global _storage
|
||||
if _storage is None:
|
||||
settings = get_settings()
|
||||
if settings.storage_backend == "s3":
|
||||
raise NotImplementedError("S3 storage not yet implemented.")
|
||||
_storage = LocalFileStorage(settings.media_path)
|
||||
return _storage
|
||||
Reference in New Issue
Block a user