This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
packageflow
import(
"net/http"
"net/url"
_log"github.com/sirupsen/logrus"
)
varlog=_log.WithField("at","flow")
typeRequeststruct{
Methodstring
URL*url.URL
Protostring
Headerhttp.Header
Body[]byte
raw*http.Request
}
funcNewRequest(req*http.Request)*Request{
return&Request{
Method:req.Method,
URL:req.URL,
Proto:req.Proto,
Header:req.Header,
raw:req,
}
}
func(r*Request)Raw()*http.Request{
returnr.raw
}
typeResponsestruct{
StatusCodeint
Headerhttp.Header
Body[]byte
decodedBody[]byte
decodedbool// decoded reports whether the response was sent compressed but was decoded to decodedBody.