Documentation
¶
Overview ¶
Package render provides HTTP response serialization and standardized error formatting.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RespondError ¶
func RespondError(w http.ResponseWriter, err error)
RespondError serializes an error into the standard ResponseEnvelope with proper HTTP status.
func RespondJSON ¶
func RespondJSON(w http.ResponseWriter, status int, data any, meta *MetaDetails)
RespondJSON serializes data and optional metadata into the standard ResponseEnvelope.
Types ¶
type ErrorDetail ¶
type MetaDetails ¶
type ResponseEnvelope ¶
type ResponseEnvelope struct {
Data any `json:"data"`
Meta *MetaDetails `json:"meta"`
Error *ErrorDetail `json:"error"`
}
ResponseEnvelope represents the standardized JSON response envelope per PRD §14.5.
Click to show internal directories.
Click to hide internal directories.