Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteJsonError ¶
func WriteJsonError(w http.ResponseWriter, err error)
func WriteJsonErrorData ¶
func WriteJsonErrorData(w http.ResponseWriter, err error, data any)
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
Code string `json:"code"`
SubCode string `json:"subcode"`
Message string `json:"message"`
}
func NewErrorResponse ¶
func NewErrorResponse(err error) *ErrorResponse
type Response ¶
type Response struct {
Status string `json:"status"`
Error *ErrorResponse `json:"error,omitempty"`
Data any `json:"data,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.