Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RespondWithJSON ¶
func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
RespondWithJSON writes out a JSON response. The header of the response writer can be initialized before calling this function.
Types ¶
type Context ¶
Context is the placeholder for the common API context struct.
func (Context) RespondWithError ¶
func (apiContext Context) RespondWithError(w http.ResponseWriter, r *http.Request, code int, message string, err error)
RespondWithError writes out a JSON error response. The header of the response writer can be initialized before calling this function.
Click to show internal directories.
Click to hide internal directories.