Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteJSONData ¶
func WriteJSONData(w http.ResponseWriter, statusCode int, data interface{}) error
WriteJSONData writes the given data to the client as a JSON response.
func WriteJSONMessage ¶
WriteJSONMessage writes a success log and response to the client with the given status code and message.
Types ¶
type HTTPMessage ¶
type HTTPMessage struct { Timestamp time.Time `json:"timestamp"` StatusCode int `json:"status_code"` Message string `json:"message"` Method string `json:"method"` Path string `json:"path"` }
func (*HTTPMessage) Error ¶
func (e *HTTPMessage) Error() string
func (*HTTPMessage) String ¶
func (e *HTTPMessage) String() string
Click to show internal directories.
Click to hide internal directories.