Documentation ¶
Index ¶
- func DecodeRequest(r *http.Request, data interface{}) (err error)
- func DecodeResponse(res *http.Response, data interface{}) (err error)
- func EncodeRequest(req *http.Request, data interface{}, contentTypes ...string) error
- func EncodeResponse(w http.ResponseWriter, data interface{}, status int, contentTypes ...string) error
- func ErrorHandler(w http.ResponseWriter, r *http.Request, msg string, code int, err error) error
- func Handler(w http.ResponseWriter, r *http.Request, data interface{}, ...) (code int, err error)
- func Request(ctx context.Context, method, url string, payload, data interface{}) error
- type RFC7807Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeRequest ¶
DecodeRequest decodes http request body.
func DecodeResponse ¶ added in v0.0.25
DecodeResponse decodes http response body.
func EncodeRequest ¶ added in v0.0.25
EncodeRequest encodes http request.
func EncodeResponse ¶
func EncodeResponse(w http.ResponseWriter, data interface{}, status int, contentTypes ...string, ) error
EncodeResponse encodes http response body.
func ErrorHandler ¶
ErrorHandler responds to an HTTP request to send RFC 7807 error.
Types ¶
Click to show internal directories.
Click to hide internal directories.