Source code for raftnode.datastore.Idatastore
from abc import ABC, ABCMeta, abstractmethod
[docs]class IDatastore(ABC):
[docs] @abstractmethod
def put(self, key: str, value: str):
'''
Implement this function to insert data into database
'''
[docs] @abstractmethod
def get(self, key: str):
'''
Implement this function to retrieve data from database
'''
[docs] @abstractmethod
def connect(self):
'''
Implement this function to connect and interact
with the database
'''