Custom storage
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.
Examples
You may use existing storages as an example and a good starting point to create your own implementation:
Notes
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.
Debugging
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.
Last updated