Skip to main content
View module source on GitHub

MaximCache

class MaximCache()
Abstract base class for caching implementations in Maxim. This class defines the interface for cache operations including getting, setting, deleting cache entries, and retrieving all keys. Concrete implementations should inherit from this class and provide actual storage mechanisms.

get_all_keys

def get_all_keys() -> List[str]
Retrieve all keys currently stored in the cache. Returns:
NameDescription
List[str]A list of all cache keys. Returns empty list if no keys exist.

get

def get(key: str) -> Optional[str]
Retrieve a value from the cache by its key. Arguments:
NameTypeDescription
keystrThe cache key to look up.
Returns:
NameDescription
Optional[str]The cached value if the key exists, None otherwise.

set

def set(key: str, value: str) -> None
Store a key-value pair in the cache. Arguments:
NameTypeDescription
keystrThe cache key to store the value under.
valuestrThe value to cache.

delete

def delete(key: str) -> None
Remove a key-value pair from the cache. Arguments:
NameTypeDescription
keystrThe cache key to remove.