swh.journal.writer.interface module#

class swh.journal.writer.interface.ValueProtocol(*args, **kwargs)[source]#

Bases: Protocol

anonymize() TSelf | None[source]#
unique_key() Dict[str, str] | Dict[str, bytes] | bytes[source]#
to_dict() Dict[str, Any][source]#
class swh.journal.writer.interface.JournalWriterInterface(*args, **kwargs)[source]#

Bases: Protocol

write_addition(object_type: str, object_: ValueProtocol) None[source]#

Add a SWH object of type object_type in the journal.

write_additions(object_type: str, objects: Iterable[ValueProtocol]) None[source]#

Add a list of SWH objects of type object_type in the journal.

flush() None[source]#

Flush the pending object additions in the backend, if any.