Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRequestError ¶
NewRequestError wraps a provided error with an HTTP status code. This function should be used when handlers encounter expected errors.
func RespondError ¶
func RespondError(w http.ResponseWriter, err error) error
RespondError sends an error response back to the client.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the entrypoint into our application and what controls the context of each request. Feel free to add any configuration data/logic on this type.
type Error ¶
Error is used to pass an error during the request through the application with web specific context.
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse is the form used for API responses from failures in the API.
Click to show internal directories.
Click to hide internal directories.