parsedmarc.sink.base
π
BaseConfig
π
Bases: BaseModel
Base config for all sinks.
New in 9.0.
Sink
π
Bases: LoggingMixin
Base class for Sinks. Sinks receive reports for processing.
New in 9.0.
| PARAMETER | DESCRIPTION |
|---|---|
name |
profile name for this instance, ideally should be unqiue to easily idenfity this instance and any log messages it produces
TYPE:
|
config |
config for this instance |
cleanup
π
Perform cleanup on this source.
This method is called as a part of self.shutdown.
Child classes can override this method to implement their own logic.
It is still recomended to call super().cleanup().
process_report
π
process_report(report: Report) -> None
Default method for processing reports.
Rather than directly processing reports, checks for methods matching a given report type and if it exists passes teh report to it. If no method exists for the given report does nothing.
Supported methods:
process_aggregate_reportprocess_forensic_report
setup
π
Perform setup actions to ensure this Sink is ready to produce.
Child classes can override this method to implement their own logic.
Child classes should
- check that
self._state == AppState.SHUTDOWN - set
self._state = AppState.SETTING_UP - do their setup actions
- if an error occurs set
self._state = AppState.SETUP_ERROR - otherwise set
self._state = AppState.RUNNING
shutdown
π
validate_config
π
Validate the config of this instance
Child classes can override this method to implement their own logic.
It is still recomended to call super().validate_config().