mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-22 02:37:57 -05:00
[V3 Config] Add MongoDB driver (#972)
* Basic Mongo Driver * Update docstrings * WIP motor support * Use motor * Update docs, add selective importer * Make use of selective importer * Fix docs * Fix config storage location for JSON * Add delimiters in the drivers doc section * Make async things async * Add basic config information for mongo driver * get info from basic setup into config * IT WORKS * Add dependency for RJM's PR.
This commit is contained in:
@@ -3,11 +3,40 @@ from typing import Tuple
|
||||
__all__ = ["BaseDriver"]
|
||||
|
||||
class BaseDriver:
|
||||
def __init__(self, cog_name):
|
||||
self.cog_name = cog_name
|
||||
|
||||
def get_driver(self):
|
||||
raise NotImplementedError
|
||||
|
||||
async def get(self, identifiers: Tuple[str]):
|
||||
"""
|
||||
Finds the value indicate by the given identifiers.
|
||||
|
||||
:param identifiers:
|
||||
A list of identifiers that correspond to nested dict accesses.
|
||||
:return:
|
||||
Stored value.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def get_config_details(self):
|
||||
"""
|
||||
Asks users for additional configuration information necessary
|
||||
to use this config driver.
|
||||
|
||||
:return:
|
||||
Dict of configuration details.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
async def set(self, identifiers: Tuple[str], value):
|
||||
"""
|
||||
Sets the value of the key indicated by the given identifiers.
|
||||
|
||||
:param identifiers:
|
||||
A list of identifiers that correspond to nested dict accesses.
|
||||
:param value:
|
||||
Any JSON serializable python object.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
Reference in New Issue
Block a user