Add interfaces for Address Book, PeerStore Metadata, and Peerstore

This commit is contained in:
Stuckinaboot
2018-10-20 16:55:15 -04:00
parent 48dfd9a77a
commit eacb7eac6d
3 changed files with 125 additions and 0 deletions

View File

@ -0,0 +1,25 @@
from abc import ABC, abstractmethod
class IPeerMetadata(ABC):
def __init__(self, context):
self.context = context
@abstractmethod
def get(self, peerID, key):
"""
:param peerID: peer ID to lookup key for
:param key: key to look up
:return: value at key for given peer, error
"""
pass
@abstractmethod
def put(self, peerID, key, val):
"""
:param peerID: peer ID to lookup key for
:param key: key to associate with peer
:param val: value to associated with key
:return: error
"""
pass