-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
- http becomes the root as server - benchttp structs definition moves to benchttp package - httplog is a helper module at the root
- swap Benchmark field with Report - update firestore service - update server injectees
e44d3e0 to
4262e28
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though I'm not a fan of having source files at the root mixed with config files, it works really well here with the name of the module (e.g. server.New).
I also really like the domain package benchttp, I'm wondering whether we should consider porting it to the runner (might not work as well as there's much more going on with the equivalent entities).
firestore/report.go
Outdated
| // CloseClient calls the Close method of the internal client | ||
| // of the ReportService. | ||
| func (s ReportService) CloseClient() { | ||
| s.client.Close() | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question] This is not used, what should we do about it?
[nitpick] I'd keep the implementation details to the implementation itself, considering the underlying client is private.
| // CloseClient calls the Close method of the internal client | |
| // of the ReportService. | |
| func (s ReportService) CloseClient() { | |
| s.client.Close() | |
| } | |
| // Close closes the connection to Firestore client. | |
| func (s ReportService) Close() error { | |
| return s.client.Close() | |
| } |
Merge errorCode and errorMessage helpers inside httpErrorOf
GregoryAlbouy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
My only remaining concerns are:
- the
405returned in certain cases of invalid id: not ideal but secondary and can be improved later - the endpoint path that I believe would be more conventional in format
/reports/{id}, but the query param works well too so let's let the author choose 🤷♂️
GregoryAlbouy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
Only thing remaining. What happens:
Calling |
Yes, now it makes perfect sense because the two endpoints do not share the same path anymore. |
Description
Architectural changes and sync with benchttp/runner regarding data structure and endpoints.
Changes
server(previoushttp) is at the root, benchttp entities are insidebenchttpBenchmarkandReportstructs/v1subrouterNotes