added infrastructure code
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
"""Definition of ImageRepositoryInterface"""
|
||||
|
||||
from uuid import UUID
|
||||
from abc import ABC, abstractmethod
|
||||
from PIL import Image
|
||||
|
||||
|
||||
class ImageRepositoryInterface(ABC):
|
||||
"""ImageRepository interface."""
|
||||
|
||||
@abstractmethod
|
||||
def get(self, image_id: UUID) -> Image.Image | None:
|
||||
"""Retrieve an Image by its ID."""
|
||||
raise NotImplementedError()
|
||||
|
||||
@abstractmethod
|
||||
def put(self, image: Image.Image, image_id: UUID) -> None:
|
||||
"""Update or create an Image."""
|
||||
raise NotImplementedError()
|
||||
|
||||
@abstractmethod
|
||||
def delete(self, image_id: UUID) -> None:
|
||||
"""Delete an Image by its ID."""
|
||||
raise NotImplementedError()
|
||||
|
||||
@abstractmethod
|
||||
def list_all(self) -> list[UUID]:
|
||||
"""List all image IDs in the repository."""
|
||||
raise NotImplementedError()
|
||||
Reference in New Issue
Block a user