KelDB Hooks

class keldb.hooks.FileStoreHook(dir: str, locks_count: int = 10000)

Bases: Hook

Filesystem-backed storage implementation.

Each node is stored as a directory. The value is stored in value.json inside the directory.

async check_path_exists(path: str, cached: bool = False) bool
async delete_path(path: str, cached: bool = False) None
async get_path_directory(path: str, file: str = '') str
async get_path_value(path: str, cached: bool = False) Any
async list_path_subpaths(path: str, cached: bool = False) AsyncIterator[str]
async set_path_value(path: str, value: Any, cached: bool = False) None
class keldb.hooks.Hook

Bases: object

Abstract storage backend interface.

async check_path_exists(path: str, cached: bool = False) bool
async delete_path(path: str, cached: bool = False) None
async get_path_value(path: str, cached: bool = False) Any
async list_path_subpaths(path: str, cached: bool = False) AsyncIterator[str]
async set_path_value(path: str, value: Any, cached: bool = False) Any
class keldb.hooks.MemoryStoreHook

Bases: object

Simple memory-backed storage implementation. (for testing)

async check_path_exists(path: str, cached: bool = False) bool
async delete_path(path: str, cached: bool = False) None
async get_path_dict(path: str, create: bool = False) dict
async get_path_value(path: str, cached: bool = False) Any
async list_path_subpaths(path: str, cached: bool = False) AsyncIterator[str]
async set_path_value(path: str, value: Any, cached: bool = False) Any