Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RespondWithError ¶
func RespondWithError(w http.ResponseWriter, statusCode int, errorCode models.ConsentErrorCode, message string)
RespondWithError sends a JSON error response with the given status code This version accepts models.ConsentErrorCode for type-safe error codes
func RespondWithJSON ¶
func RespondWithJSON(w http.ResponseWriter, statusCode int, payload interface{})
RespondWithJSON sends a JSON response with the given status code
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
Error struct {
Code string `json:"code"`
Message string `json:"message"`
} `json:"error"`
}
ErrorResponse represents a standardized error response
Click to show internal directories.
Click to hide internal directories.