Commit Graph

6 Commits

Author SHA1 Message Date
Martijn Pieters
d10f4af6d6 Import supported backends
This ensures that any syntax issues are caught early (by type checkers
and tests). Backends that are missing dependencies are skipped. By
importing, this exposed an issue where the redis type annotations
raised an exception, which has been fixed by using forward annotations.

To help avoid import dependency hell, the Backend ABC has been moved to
`fastapi_cache.types`. In the process, it has been made an actual ABC.
2023-05-14 17:02:30 +01:00
Martijn Pieters
23d439f83a Make backends store bytes instead of strings
This is, for the majority of backends, the native format anyway, and so
we save encoding and decoding when using the PickleCodec or if (in future)
a orjson Coder was to be added.

For the JsonCodec, the only thing that changed is the location where the
JSON data is encoded to bytes and decoded back again to a string.
2023-05-10 17:35:15 +01:00
long2ice
8f0920d0d7 ci: fix 2022-11-07 16:39:17 +08:00
Ivan Moiseev
4c6abcf786 feat: add more type hints 2022-10-22 20:59:37 +04:00
long2ice
e483e0dc55 add clear method 2020-11-03 18:08:06 +08:00
long2ice
c20bb73f27 first commit 2020-08-26 18:04:57 +08:00