Documentation
¶
Overview ¶
A Flexible ServeMux and HandlerFunc - Implement interfaces to determine how function arguments, results, and errors are mapped to the http request and response. Then write functions instead of http.Handlers or http.HandlerFunc's
Index ¶
- func Error(code int, msg string) error
- func Errorf(code int, msg string, args ...interface{}) error
- func HandleResponseError(res http.ResponseWriter, req *http.Request, err error)
- func HandlerFunc(handler interface{}) http.Handler
- func RegisterAdaptor(typ reflect.Type, adaptor adaptorFunc)
- func WrapError(code int, err error) error
- type ByMethod
- type Documentation
- type Endpoint
- type FromRequest
- type HTTPError
- type ParamInfo
- type Paths
- type ServeMux
- type ToResponse
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleResponseError ¶
func HandleResponseError(res http.ResponseWriter, req *http.Request, err error)
func HandlerFunc ¶
func RegisterAdaptor ¶
Types ¶
type Documentation ¶
type Endpoint ¶
type Endpoint struct {
Method string `json:"method,omitempty"`
Path string `json:"path"`
Description string `json:"description,omitempty"`
RequestBody string `json:"requestBody,omitempty"`
ResponseBody string `json:"responseBody,omitempty"`
Params map[string]ParamInfo `json:"params,omitempty"`
Notes []string `json:"notes,omitempty"`
}
type FromRequest ¶
type FromRequest generate.FromRequest
type ServeMux ¶
type ServeMux struct {
*Paths
}
func NewServeMux ¶
func NewServeMux() *ServeMux
func (*ServeMux) Documentation ¶
func (sm *ServeMux) Documentation(introduction ...string) *Documentation
func (*ServeMux) DocumentationHTML ¶
type ToResponse ¶
type ToResponse generate.ToResponse
Source Files
¶
Click to show internal directories.
Click to hide internal directories.