Compare commits

...

4 Commits

Author SHA1 Message Date
Alex Haynes
2df8a2c9c2 updated based on comments 2019-02-24 18:30:58 -05:00
Alex Haynes
d47c423c73 fixed linting 2019-02-10 20:22:01 -05:00
Alex Haynes
0d05c1cd1b basic interface modeled on go repo 2019-02-10 18:15:15 -05:00
Alex Haynes
4e0fbf0470 added file 2019-02-10 17:46:25 -05:00
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,16 @@
from abc import ABC, abstractmethod
# pylint: disable=too-few-public-methods
class IAdvertiser(ABC):
def __init__(self):
pass
@abstractmethod
def advertise(self, service):
"""
Advertise providing a specific service to the network
:param service: service that you provide
:raise Exception: network error
"""

View File

@ -0,0 +1,17 @@
from abc import ABC, abstractmethod
# pylint: disable=too-few-public-methods
class IDiscoverer(ABC):
def __init__(self):
pass
@abstractmethod
def find_peers(self, service):
"""
Find peers on the networking providing a particular service
:param service: service that peers must provide
:return: PeerInfo generator that yields PeerInfo objects for discovered peers
:raise Exception: network error
"""