Versions in this module Expand all Collapse all v1 v1.0.1 Aug 15, 2024 Changes in this version + var BaseTransport http.RoundTripper = &http.Transport + var DefaultBufferPool = NewBufferPool(1024 * 3) + var ProxyConfig = &httpproxy.Config + func AppendDirectors(ctx context.Context, director ...func(r *http.Request)) + func DoNothingDirector(_ *http.Request) + func EqualFold(s, t string) bool + func GenCurl(infor HttpInfor) string + func IsPrint(s string) bool + func NewBufferPool[IntegerType ...](size IntegerType) httputil.BufferPool + func RegisterFilterCreator(name string, creator FilterCreator) + type ActualRequestFilter interface + OnActualRequest func(ctx context.Context, infor HttpInfor) + type BufferPool interface + Get func() []byte + Put func([]byte) + type CtxKeyHandleFuncForActualRequest struct + CtxKeyHandleFuncForActualRequest any + type CtxKeyMap struct + CtxKeyMap any + type CtxKeyPath struct + CtxKeyPath any + type CtxKeyPathMatcher struct + CtxKeyPathVars any + type CurlPrinterTransport struct + Inner http.RoundTripper + Logger logs.Logger + func (t *CurlPrinterTransport) RoundTrip(req *http.Request) (*http.Response, error) + type DefaultResponseFilter struct + func NewDefaultResponseFilter() *DefaultResponseFilter + func (d *DefaultResponseFilter) OnResponseChunk(ctx context.Context, _ HttpInfor, w Writer, chunk []byte) (signal Signal, err error) + func (d *DefaultResponseFilter) OnResponseChunkImmutable(ctx context.Context, _ HttpInfor, copiedChunk []byte) (signal Signal, err error) + func (d *DefaultResponseFilter) OnResponseEOF(ctx context.Context, _ HttpInfor, w Writer, chunk []byte) (err error) + func (d *DefaultResponseFilter) OnResponseEOFImmutable(ctx context.Context, _ HttpInfor, copiedChunk []byte) (err error) + type DoNothingTransport struct + Response *http.Response + func (d *DoNothingTransport) RoundTrip(req *http.Request) (*http.Response, error) + type Enable interface + Enable func(context.Context, *http.Request) bool + type Filter any + type FilterConfig struct + Config json.RawMessage + Name string + type FilterCreator func(json.RawMessage) (Filter, error) + func GetFilterCreator(name string) (FilterCreator, bool) + func MustGetFilterCreator(name string) FilterCreator + type HttpInfor interface + Body func() io.ReadCloser + BodyBuffer func(all ...bool) *bytes.Buffer + ContentLength func() int64 + Cookie func(string) (*http.Cookie, error) + Header func() http.Header + Host func() string + Method func() string + RemoteAddr func() string + Request func() *http.Request + SetBody func(body io.ReadCloser, size int64) + SetBody2 func(body interface{}) + Status func() string + StatusCode func() int + URL func() *url.URL + func NewInfor[R httputil.RequestResponse](ctx context.Context, r R) HttpInfor + type ImmutableResponseFilter interface + OnResponseChunkImmutable func(ctx context.Context, infor HttpInfor, copiedChunk []byte) (signal Signal, err error) + OnResponseEOFImmutable func(ctx context.Context, infor HttpInfor, copiedChunk []byte) error + type LoggerCtxKey struct + LoggerCtxKey any + type MapKeyDirectors struct + CtxKeyDirectors any + type MultiByteWriter struct + func NewMultiByteWriter(writers ...io.Writer) *MultiByteWriter + func (mbw *MultiByteWriter) Write(p []byte) (n int, err error) + func (mbw *MultiByteWriter) WriteByte(c byte) error + type MultiResponseWriter interface + MultiResponseWriter func(ctx context.Context) []io.ReadWriter + type MutexCtxKey struct + MutexCtxKey any + type NamingFilter struct + Filter Filter + Name string + type OriginalRequestFilter interface + OnOriginalRequest func(ctx context.Context, infor HttpInfor) + type RequestFilter interface + OnRequest func(ctx context.Context, w http.ResponseWriter, infor HttpInfor) (signal Signal, err error) + type ResponseFilter interface + OnResponseChunk func(ctx context.Context, infor HttpInfor, w Writer, chunk []byte) (signal Signal, err error) + OnResponseEOF func(ctx context.Context, infor HttpInfor, w Writer, chunk []byte) error + type ReverseProxy struct + BufferPool BufferPool + Context context.Context + Director func(*http.Request) + ErrorHandler func(http.ResponseWriter, *http.Request, error) + ErrorLog *log.Logger + Filters []NamingFilter + FlushInterval time.Duration + ModifyResponse func(*http.Response) error + Transport http.RoundTripper + func (p *ReverseProxy) Clone() *ReverseProxy + func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) + type Signal int + const Continue + const Intercept + func (s Signal) String() string + type TimerTransport struct + Inner http.RoundTripper + Logger logs.Logger + func (t *TimerTransport) RoundTrip(req *http.Request) (*http.Response, error) + type Writer interface