Documentation
¶
Index ¶
- Constants
- func Decode(r *http.Request, val interface{}) error
- func IsShutdown(err error) bool
- func NewRequestError(err error, status int) error
- func NewShutdownError(message string) error
- func Param(r *http.Request, key string) string
- func Params(r *http.Request) map[string]string
- func Respond(ctx context.Context, w http.ResponseWriter, data interface{}, statusCode int) error
- func RespondError(ctx context.Context, w http.ResponseWriter, err error) error
- type App
- type Error
- type ErrorResponse
- type FieldError
- type Handler
- type Middleware
- type PaginatedLimitOffsetResponse
- type Values
Constants ¶
View Source
const KeyValues ctxKey = 1
KeyValues ...
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode reads the body of an HTTP request looking for a JSON document. The body is decoded into the provided value.
If the provided value is a struct then it is checked for validation tags.
func IsShutdown ¶
func RespondError ¶
Types ¶
type App ¶
type App struct { *httptreemux.ContextMux // contains filtered or unexported fields }
App ...
type ErrorResponse ¶
type ErrorResponse struct { Error string `json:"error"` Fields []FieldError `json:"fields,omitempty"` }
ErrorResponse ...
type FieldError ¶
FieldError ...
Click to show internal directories.
Click to hide internal directories.