gitea-sonarqube-bot/internal/api
justusbunsi 525fa03065
Centralize API response handling
Currently, all API handler functions take care of response code and
message on their own. This leads to a huge injection chain for HTTP
related objects.

This refactors the API to consistently return response code and message
to the API main entrypoint where the response is created and sent.

Now, SonarQube and Gitea will get a response at the very end of any bot
action for one request. SonarQube has a timeout of 10 seconds, which may
be reached due to network latency. We'll see.

Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
2022-07-11 15:24:43 +02:00
..
gitea.go Centralize API response handling 2022-07-11 15:24:43 +02:00
gitea_test.go Centralize API response handling 2022-07-11 15:24:43 +02:00
main.go Centralize API response handling 2022-07-11 15:24:43 +02:00
main_test.go Centralize API response handling 2022-07-11 15:24:43 +02:00
request_validation.go Remove debug logging 2022-06-12 13:28:31 +02:00
request_validation_test.go Add webhook secret validation 2022-05-21 19:05:09 +02:00
sonarqube.go Centralize API response handling 2022-07-11 15:24:43 +02:00
sonarqube_test.go Centralize API response handling 2022-07-11 15:24:43 +02:00