mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2025-12-06 14:26:22 +00:00
mux UnderlyingRequest
This commit is contained in:
parent
a61556d857
commit
abd045493a
@ -137,6 +137,12 @@ func (h *HTTPRequest) AllHeaders() map[string]string {
|
|||||||
return headers
|
return headers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UnderlyingRequest returns the underlying *http.Request
|
||||||
|
// This is useful when you need to pass the request to other handlers
|
||||||
|
func (h *HTTPRequest) UnderlyingRequest() *http.Request {
|
||||||
|
return h.req
|
||||||
|
}
|
||||||
|
|
||||||
// HTTPResponseWriter adapts our ResponseWriter interface to standard http.ResponseWriter
|
// HTTPResponseWriter adapts our ResponseWriter interface to standard http.ResponseWriter
|
||||||
type HTTPResponseWriter struct {
|
type HTTPResponseWriter struct {
|
||||||
resp http.ResponseWriter
|
resp http.ResponseWriter
|
||||||
@ -166,6 +172,12 @@ func (h *HTTPResponseWriter) WriteJSON(data interface{}) error {
|
|||||||
return json.NewEncoder(h.resp).Encode(data)
|
return json.NewEncoder(h.resp).Encode(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UnderlyingResponseWriter returns the underlying http.ResponseWriter
|
||||||
|
// This is useful when you need to pass the response writer to other handlers
|
||||||
|
func (h *HTTPResponseWriter) UnderlyingResponseWriter() http.ResponseWriter {
|
||||||
|
return h.resp
|
||||||
|
}
|
||||||
|
|
||||||
// StandardMuxAdapter creates routes compatible with standard http.HandlerFunc
|
// StandardMuxAdapter creates routes compatible with standard http.HandlerFunc
|
||||||
type StandardMuxAdapter struct {
|
type StandardMuxAdapter struct {
|
||||||
*MuxAdapter
|
*MuxAdapter
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user