src.api.api_port

API Adapter module.

 1"""API Adapter module."""
 2
 3from abc import ABC, abstractmethod
 4
 5from src.config.config_port import ConfigRepoPort
 6from src.offers.offer_service import OfferService
 7
 8
 9class ApiPort(ABC):
10    """API Protocol."""
11
12    offer_service: OfferService
13
14    @abstractmethod
15    def __init__(
16        self,
17        config: ConfigRepoPort,
18        offer_service: OfferService,
19    ) -> None:
20        """Initialize the API."""
21        ...
22
23    @abstractmethod
24    def run(self):
25        """Run the API daemon"""
26        ...
class ApiPort(abc.ABC):
10class ApiPort(ABC):
11    """API Protocol."""
12
13    offer_service: OfferService
14
15    @abstractmethod
16    def __init__(
17        self,
18        config: ConfigRepoPort,
19        offer_service: OfferService,
20    ) -> None:
21        """Initialize the API."""
22        ...
23
24    @abstractmethod
25    def run(self):
26        """Run the API daemon"""
27        ...

API Protocol.

@abstractmethod
ApiPort( config: src.config.config_port.ConfigRepoPort, offer_service: src.offers.offer_service.OfferService)
15    @abstractmethod
16    def __init__(
17        self,
18        config: ConfigRepoPort,
19        offer_service: OfferService,
20    ) -> None:
21        """Initialize the API."""
22        ...

Initialize the API.

@abstractmethod
def run(self):
24    @abstractmethod
25    def run(self):
26        """Run the API daemon"""
27        ...

Run the API daemon