Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteMessage ¶
func WriteMessage(code int, status string, message string, w http.ResponseWriter)
Write a message with a given status code, a status and a message
func WriteUnauthorized ¶
func WriteUnauthorized(w http.ResponseWriter)
Write a message saying that the client should provide authentication details
func WriteUnprocessableEntity ¶
func WriteUnprocessableEntity(w http.ResponseWriter)
Write a message saying that we cannot parse the given JSON payload
Types ¶
type APIMessage ¶
type APIMessage struct {
// The status key
Status string `json:"status"`
// A human-readable message
Message string `json:"message"`
// contains filtered or unexported fields
}
A simple struct to easily respond some JSON
Click to show internal directories.
Click to hide internal directories.