Documentation ¶
Overview ¶
Package web provides the api endpoints for the urstore
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrInternalError ¶
ErrInternalError render an invalid request
func ErrInvalidRequest ¶
ErrInvalidRequest render an invalid request
func ErrNotFound ¶
ErrNotFound render an invalid request
func RegisterEndpoints ¶
RegisterEndpoints register application endpoints
Types ¶
type ErrResponse ¶
type ErrResponse struct { Err error `json:"-"` // low-level runtime error HTTPStatusCode int `json:"-"` // http response status code AppCode int `json:"code,omitempty"` // application-specific error code ErrorText string `json:"message,omitempty"` // application-level error message, for debugging }
ErrResponse renderer type for handling all sorts of errors.
In the best case scenario, the excellent github.com/pkg/errors package helps reveal information on the error, setting it on Err, and in the Render() method, using it to set the application-specific error code in AppCode.
func (*ErrResponse) Render ¶
func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error
Render an ErrResponse
Click to show internal directories.
Click to hide internal directories.