raftnode.datastore package

Submodules

raftnode.datastore.Idatastore module

class raftnode.datastore.Idatastore.IDatastore[source]

Bases: abc.ABC

abstract connect()[source]

Implement this function to connect and interact with the database

abstract delete(key: str)[source]

Implement this function to delete data from database

abstract get(key: str)[source]

Implement this function to retrieve data from database

abstract put(key: str, value: str)[source]

Implement this function to insert data into database

raftnode.datastore.memory module

class raftnode.datastore.memory.MemoryStore[source]

Bases: raftnode.datastore.Idatastore.IDatastore

A class that implements IDatastore. It is responsible for storing data in-memory and retrieving it using python dictionary

connect()[source]

create/connect to the in-memory data store

delete(key: str, **kwargs) str[source]

delete data from in-memory datastore

Parameters

key (str) – key whose value will be deleted from the datastore

get(key: str, **kwargs) dict[source]

fetch data form the in-memory datastore

Parameters

key (str) – key using which data will be fetched from the dictionary

Returns

data in dictionary format

Return type

dict

put(key: str, value, **kwargs)[source]

insert values into the in-memory datastore

Parameters
  • key (str) – key using which data will be stored in the dictionary

  • value (any) – the actual data to be stored in the dictionary

raftnode.datastore.rocks module

Module contents