Documentation
¶
Overview ¶
Package ioutil provides functions for IO operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorWriter ¶
type ErrorWriter interface { // Error writes msg to http.ResponseWriter and the status code. Error(w http.ResponseWriter, msg string, status int) }
ErrorWriter is an interface for writing a generic errors like http.Error func.
type GenericError ¶
type GenericError struct { // The error message. // // example: Very useful error message Message string `json:"message"` }
GenericError is a generic error message returned by a server.
type JSONErrorWriter ¶
JSONErrorWriter interpreters an error in json format and write to http.ResponseWriter.
func (JSONErrorWriter) Error ¶
func (ew JSONErrorWriter) Error(w http.ResponseWriter, message string, status int)
Error is a helper function to write a generic error to the response writer with the given status code and message.
Click to show internal directories.
Click to hide internal directories.