ThreeDotsLabs / esja

Event Sourcing library in Go.
MIT License
20 stars 4 forks source link

Split marshaling from serialisation/mapping #18

Closed krzysztofreczek closed 1 year ago

krzysztofreczek commented 1 year ago

Why? There is a problem with the current sequence of event processing in the repository (load->serialize->anonymize? / anonymize?->serialize->save) which blocks the anonymization of the transport model. As of now the anonymizer has access to the original stream model only, considered a central, domain model with advanced implementation. Given that the anonymization is based on reflection there may be multiple edge cases (protected, complex or third-party type to name a few) where anonymization of a domain model will not be possible.

What? In order to solve the problem described above and force the library users to use and define anonymization in their transport models I did the following:

Tests I kept the existing tests with all possible combinations of configurations.