feat(storage): add local storage framework

This commit is contained in:
Schubert Ferenc 2026-07-03 18:11:58 +02:00
parent 228da8f814
commit 964b545bc5
24 changed files with 890 additions and 98 deletions

View file

@ -0,0 +1,34 @@
from abc import ABC, abstractmethod
from pathlib import Path
from app.storage.schemas import FileMetadata, StoredFileMetadata
class StorageProvider(ABC):
@abstractmethod
def save_file(
self,
*,
namespace: str,
content: bytes,
original_filename: str,
stored_filename: str,
mime_type: str,
) -> StoredFileMetadata:
raise NotImplementedError
@abstractmethod
def open_file(self, storage_key: str) -> Path:
raise NotImplementedError
@abstractmethod
def delete_file(self, storage_key: str) -> None:
raise NotImplementedError
@abstractmethod
def file_exists(self, storage_key: str) -> bool:
raise NotImplementedError
@abstractmethod
def get_file_metadata(self, storage_key: str) -> FileMetadata:
raise NotImplementedError