Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RespondError ¶
func RespondError(w http.ResponseWriter, code int, msg string) error
RespondError responds to a HTTP request with body of ErrorResponse
func RespondJSON ¶
func RespondJSON(w http.ResponseWriter, data interface{}) error
RespondJSON responds with arbitrary data objects
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
ErrorResponse is a common struct for responding error for HTTP requests
Click to show internal directories.
Click to hide internal directories.