Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, status int, i interface{})
WriteJSON encodes the JSON
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { Code string `json:"code,omitempty"` Message string `json:"message,omitempty"` }
ErrorResponse defines the standard error response
type Response ¶
type Response struct { Data interface{} `json:"data,omitempty"` Success string `json:"success,omitempty"` Errors []ErrorResponse `json:"errors,omitempty"` }
Response defines the standard output response
func NewErrorResponse ¶
NewErrorResponse writes a new error to the response
Click to show internal directories.
Click to hide internal directories.