MCPcopy Create free account
hub / github.com/Freedium-cfd/web / AbstractCacheBackend

Class AbstractCacheBackend

database-lib/database_lib/main.py:71–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69
70
71class AbstractCacheBackend(ABC):
72 @abstractmethod
73 def init_db(self):
74 pass
75
76 @abstractmethod
77 def all(self):
78 pass
79
80 @abstractmethod
81 def all_length(self) -> int:
82 pass
83
84 @abstractmethod
85 def random(self, size: int) -> list[CacheResponse]:
86 pass
87
88 @abstractmethod
89 def pull(self, key: str) -> Union[CacheResponse, None]:
90 pass
91
92 @abstractmethod
93 def push(self, key: str, value: Union[str, dict]) -> None:
94 pass
95
96 @abstractmethod
97 def delete(self, key: str) -> None:
98 pass
99
100 @abstractmethod
101 def close(self):
102 pass
103
104
105class SQLiteCacheBackend(AbstractCacheBackend):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected