Files
fastapi-cache/fastapi_cache/backends/__init__.py

29 lines
625 B
Python
Raw Normal View History

from fastapi_cache.backends import inmemory
from fastapi_cache.types import Backend
2020-08-26 18:04:57 +08:00
__all__ = ["Backend", "inmemory"]
2020-08-26 18:04:57 +08:00
# import each backend in turn and add to __all__. This syntax
# is explicitly supported by type checkers, while more dynamic
# syntax would not be recognised.
try:
from fastapi_cache.backends import dynamodb
except ImportError:
pass
else:
__all__ += ["dynamodb"]
2020-08-26 18:04:57 +08:00
try:
from fastapi_cache.backends import memcached
except ImportError:
pass
else:
__all__ += ["memcached"]
2020-11-03 18:08:06 +08:00
try:
from fastapi_cache.backends import redis
except ImportError:
pass
else:
__all__ += ["redis"]