Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetProxyHeaders ¶
SetProxyHeaders sets the proxy headers in the request.
Types ¶
type Info ¶
type Info struct {
RemoteIP string // X-Forwarded-For
RemoteHost string // X-Forwarded-Host
RemoteProto string // X-Forwarded-Proto
RemotePort int64 // X-Forwarded-Port
RemoteHeaders http.Header
TraceID string
}
Info stores request information in the context.
func InfoFromContext ¶ added in v1.8.8
InfoFromContext retrieves the Info from the context.
type ResponseWriter ¶ added in v1.8.8
type ResponseWriter struct {
http.ResponseWriter
// contains filtered or unexported fields
}
ResponseWriter is a custom http.ResponseWriter that captures the status code and response body.
func NewResponseWriter ¶ added in v1.8.8
func NewResponseWriter(w http.ResponseWriter) *ResponseWriter
NewResponseWriter creates a new ResponseWriter.
func (*ResponseWriter) Body ¶ added in v1.8.8
func (w *ResponseWriter) Body() []byte
Body returns the captured response body.
func (*ResponseWriter) StatusCode ¶ added in v1.8.8
func (w *ResponseWriter) StatusCode() int
StatusCode returns the captured status code.
func (*ResponseWriter) Write ¶ added in v1.8.8
func (w *ResponseWriter) Write(b []byte) (int, error)
Write captures the response body.
func (*ResponseWriter) WriteHeader ¶ added in v1.8.8
func (w *ResponseWriter) WriteHeader(code int)
WriteHeader captures the status code.
Click to show internal directories.
Click to hide internal directories.