Documentation ¶
Index ¶
- func ErrorEncode(decoded string) string
- func ServeError(writer http.ResponseWriter, response Error, code int)
- func ServeErrorDefault(writer http.ResponseWriter, code int)
- func ServeJSON(writer http.ResponseWriter, data interface{}, code int)
- func ServeMailError(writer http.ResponseWriter)
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorEncode ¶
ErrorEncode encodes the error to a string conforming to RFC 6749.
RFC 6749 - The OAuth 2.0 Authorization Framework 5.2. Error Response https://tools.ietf.org/html/rfc6749#section-5.2
func ServeError ¶
func ServeError(writer http.ResponseWriter, response Error, code int)
ServeError serves an error according to the given arguments.
func ServeErrorDefault ¶
func ServeErrorDefault(writer http.ResponseWriter, code int)
ServeErrorDefault serves an error with the given status code and the default messages for the code.
func ServeJSON ¶
func ServeJSON(writer http.ResponseWriter, data interface{}, code int)
ServeJSON writes given data in JSON.
func ServeMailError ¶
func ServeMailError(writer http.ResponseWriter)
ServeMailError serves an error telling email failed.
Types ¶
type Error ¶
type Error struct { ID string `json:"error,omitempty"` Description string `json:"error_description,omitempty"` URI string `json:"error_uri,omitempty"` }
Error is a structure to hold an error to serve.
The JSON-encoded structure is conforming to RFC 6749.
RFC 6749 - The OAuth 2.0 Authorization Framework 5.2. Error Response. https://tools.ietf.org/html/rfc6749#section-5.2