Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = &ErrorResponse{Code: 404, Status: "Resource not found."}
Functions ¶
func Handler ¶
func Handler(h HandlerFunc) http.HandlerFunc
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { Err error `json:"-"` // low-level runtime error Code int `json:"-"` // http response status code Status string `json:"status"` // user-level status message Message string `json:"error,omitempty"` // application-level error message, for debugging }
func Error ¶
func Error(err error) *ErrorResponse
func InvalidRequestError ¶
func InvalidRequestError(err error) *ErrorResponse
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
func (*ErrorResponse) Render ¶
func (e *ErrorResponse) Render(w http.ResponseWriter, r *http.Request) error
type HandlerFunc ¶
type HandlerFunc func(http.ResponseWriter, *http.Request) error
type Uint64Slice ¶
type Uint64Slice []uint64
func (*Uint64Slice) Bind ¶
func (us *Uint64Slice) Bind(value string) error
Click to show internal directories.
Click to hide internal directories.