Custom storage
Last updated
Last updated
In order to create a custom stroage, please implement abstract class AbstractStorage
.
Please also implement abstract method store_and_remove_duplicate
. It accepts list of CheckResults. It returns list of deduplicated and stored CheckResults. If all results are "duplicates", it returns empty list.
You may use existing storages as an example and a good starting point to create your own implementation:
Make sure to use "transactions" while implementing a storage or do everything in one big statement. It is important to correctly process either all "CheckResults" or none at all.
You may use special debug methods dataclass_to_json_str(obj)
and dataclass_to_dict_recursive(obj)
, which are exposed by snowkill
package.
These methods are capable of converting SnowKill data structures to human-readable JSON string or to Python dictionary.