Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CaptureAndRecover ¶
func CaptureAndRecover(w http.ResponseWriter, r *http.Request, endpoint string)
CaptureAndRecover is deffered in a function to prevent panics from crashing the API server. Every API endpoint should have this function deffered to avoid crashes.
func EndpointError ¶
EndpointError is used when a certain API endpoint encounters an error. This function will log the error, and report the error to Sentry as well. However, the error will not be logged or reported if the error is because of a "user fault" (e.g - the DB cannot find a key in the database, but is able to query it)
func EndpointWarning ¶
EndpointWarning is used when a certain API endpoint wants to log a warning. These warnings should be used when there is an invalid request, or a rejected request.
Types ¶
This section is empty.