Documentation ¶ Index ¶ Constants func Err(w http.ResponseWriter, r *http.Request, log *slog.Logger, op string, err error, ...) type Response func DataOK(data any) Response func DataWithError(msg string, data any) Response func Error(msg string) Response func OK() Response Constants ¶ View Source const ( StatusOK = "OK" StatusError = "Error" ) Variables ¶ This section is empty. Functions ¶ func Err ¶ func Err(w http.ResponseWriter, r *http.Request, log *slog.Logger, op string, err error, msg string, httpStatus int) Types ¶ type Response ¶ type Response struct { Status string `json:"status"` Error string `json:"error,omitempty"` Data any `json:"data,omitempty"` } func DataOK ¶ func DataOK(data any) Response func DataWithError ¶ func DataWithError(msg string, data any) Response func Error ¶ added in v1.2.1 func Error(msg string) Response func OK ¶ func OK() Response Source Files ¶ View all Source files response.go Click to show internal directories. Click to hide internal directories.