Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: abstract structs event.Raw and event.Slo into interfaces and add UID to each event #70

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

FUSAKLA
Copy link
Contributor

@FUSAKLA FUSAKLA commented Aug 24, 2021

I intended to just add the UID to each event.

The unfortunate thing is that we used the event structs Raw and Slo directly with exported fields, so we had no way of ensuring each event has the UID. We would need a constructor of some kind.

It would be all way simpler if we would use the interfaces from the beginning. Unfortunately, it was not the case.

TBH, the separate events Raw and Slo are almost identical. I'm thinking if we need to have both of them at all.
In that case, the change would be quite easy after switching to the interfaces now.

So... eventually I took the stab and refactored the event structs into interfaces and switched to having constructors which ensures consistency in the events and that they have the UID set.

And once again, It's huge, and I don't know how to split this, sorry :/

Tests are passing, e2e tests are passing, and I tested it locally. Hopefully it does not break anything 🤞

go.mod Outdated Show resolved Hide resolved
pkg/stringmap/stringmap.go Show resolved Hide resolved
pkg/event/interfaces.go Outdated Show resolved Hide resolved
pkg/event/interfaces.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants