Versions in this module Expand all Collapse all v1 v1.0.1 Sep 12, 2018 Changes in this version + const RequestUUIDHeader + var DefaultErrorUnmarshaler = ErrorUnmarshaler(new(RemoteError)) + var ErrBadUnmarshalType = errgo.New("httprequest bad unmarshal type") + var ErrUnmarshal = errgo.New("httprequest unmarshal error") + func ErrorUnmarshaler(template error) func(*http.Response) error + func Marshal(baseURL, method string, x interface{}) (*http.Request, error) + func RequestUUID(ctx context.Context) string + func ToHTTP(h httprouter.Handle) http.Handler + func Unmarshal(p Params, x interface{}) error + func UnmarshalJSONResponse(resp *http.Response, x interface{}) error + func WriteJSON(w http.ResponseWriter, code int, val interface{}) error + type BytesReaderCloser struct + func (BytesReaderCloser) Close() error + type Client struct + BaseURL string + Doer Doer + UnmarshalError func(resp *http.Response) error + func (c *Client) Call(params, resp interface{}) error + func (c *Client) CallURL(url string, params, resp interface{}) error + func (c *Client) Do(req *http.Request, body io.ReadSeeker, resp interface{}) error + func (c *Client) Get(url string, resp interface{}) error + type CustomHeader struct + Body interface{} + SetHeaderFunc func(http.Header) + func (h CustomHeader) MarshalJSON() ([]byte, error) + func (h CustomHeader) SetHeader(header http.Header) + type DecodeRequestError struct + DecodeError error + Request *http.Request + func (e *DecodeRequestError) Error() string + type DecodeResponseError struct + DecodeError error + Response *http.Response + func (e *DecodeResponseError) Error() string + type Doer interface + Do func(req *http.Request) (*http.Response, error) + type DoerWithBody interface + DoWithBody func(req *http.Request, body io.ReadSeeker) (*http.Response, error) + type ErrorHandler func(Params) error + type ErrorMapper func(err error) (httpStatus int, errorBody interface{}) + func (e ErrorMapper) Handle(f interface{}) Handler + func (e ErrorMapper) HandleErrors(handle ErrorHandler) httprouter.Handle + func (e ErrorMapper) HandleJSON(handle JSONHandler) httprouter.Handle + func (e ErrorMapper) Handlers(f interface{}) []Handler + func (e ErrorMapper) WriteError(w http.ResponseWriter, err error) + type Handler struct + Handle httprouter.Handle + Method string + Path string + type HeaderSetter interface + SetHeader func(http.Header) + type JSONHandler func(Params) (interface{}, error) + type Params struct + Context context.Context + PathPattern string + PathVar httprouter.Params + Request *http.Request + Response http.ResponseWriter + type RemoteError struct + Code string + Info *json.RawMessage + Message string + func (e *RemoteError) Error() string + type Route struct Incompatible versions in this module v2.0.0+incompatible Oct 18, 2017