netbird
netbird copied to clipboard
Refactor Route IDs
Describe your changes
We have at least 3 distinct IDs in use for routes:
IDinroute.Route, which is the ID in the databaseNetIDinroute.Route, which is the Name/ID in the dashboardHAUniqueIDwhich is a combination ofRoute.NetIDandRoute.Network
Having so many IDs using all string it's hard to distinguish them from each other.
This PR refactors the IDs to use dedicated types to avoid mixing them up.
Conversions from/to string must be done explicitly. Conversions between the types must not happen.
Issue ticket number and link
Checklist
- [ ] Is it a bug fix
- [ ] Is a typo/documentation fix
- [ ] Is a feature enhancement
- [x] It is a refactor
- [ ] Created tests that fail without the change (if possible)
- [ ] Extended the README / documentation, if necessary