Johan B.W. de Vries 13dc426fc5 It lives \o/
2023-04-11 11:35:08 +02:00

26 lines
590 B
Python

from typing import Dict, Optional, List
from .method import Method
class Service:
__slots__ = ('name', 'methods', )
name: str
methods: Dict[str, Method]
def __init__(self, name: str, methods: List[Method]) -> None:
self.name = name
self.methods = {
x.name: x
for x in methods
}
def __repr__(self) -> str:
return f'Service({repr(self.name)}, {repr(list(self.methods.values()))})'
class ServiceDiscoveryInterface:
def find_service(self, name: str) -> Optional[Service]:
raise NotImplementedError