Cache
This class provides a unified interface for creating and interacting with different types of cache (e.g., Redis, Disk). It abstracts the underlying cache implementation details, providing methods for cache operations.
Attributes:
config (Dict[str, Any]): A dictionary containing cache configuration.
cache: The cache instance created based on the provided configuration.
Initialize the Cache with the given configuration.
Validates the configuration keys and creates the cache instance.
Parameters:
Class Attributes
ALLOWED_CONFIG_KEYS
Static Methods
cosmos_db
Parameters:
Returns:
disk
Parameters:
Returns:
get_current_cache
Returns:
Cache: The current cache instance. Parameters:
Returns:
redis
Parameters:
Returns:
Instance Methods
close
Perform any necessary cleanup, such as closing connections or releasing resources.
get
Parameters:
Returns:
set
Parameters: