Documentation
¶
Overview ¶
Package common provides shared HTTP utility functions for API handlers.
Package common provides shared HTTP utility functions for API handlers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAndValidateURLParam ¶ added in v0.3.3
GetAndValidateURLParam extracts, decodes, and validates a URL parameter from the request. Returns the decoded value or an error if invalid. Validation rules: - Must not be empty after trimming whitespace - Must not contain any whitespace characters
func WriteErrorResponse ¶
func WriteErrorResponse(w http.ResponseWriter, message string, statusCode int)
WriteErrorResponse writes a standardized error response
func WriteJSONResponse ¶
func WriteJSONResponse(w http.ResponseWriter, data interface{}, statusCode int)
WriteJSONResponse writes a JSON response with the given data
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.