-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkey_value_abc.py
34 lines (25 loc) · 933 Bytes
/
key_value_abc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""TcEx Framework Module"""
# standard library
from abc import ABC, abstractmethod
from typing import Any
class KeyValueABC(ABC):
"""Abstract base class for all KeyValue clients."""
@abstractmethod
def create(self, context: str, key: str, value: Any) -> int:
"""Create key/value pair in remote KV store.
Args:
context: A specific context for the create.
key: The key to create in KV store.
value: The value to store in KV store.
Returns:
(string): The response from the KV store provider.
"""
@abstractmethod
def read(self, context: str, key: str) -> Any:
"""Read data from KV store for the provided key.
Args:
context: A specific context for the create.
key: The key to read in KV store.
Returns:
(any): The response data from the KV store provider.
"""