Documentation ¶
Index ¶
- func DumpHttp(level slog.Level) func(http.RoundTripper) http.RoundTripper
- func PanicCatcher(next http.RoundTripper) http.RoundTripper
- func RoundTripperSequencer(baseRoundTripper http.RoundTripper, ...) http.RoundTripper
- func Timer(level slog.Level) func(http.RoundTripper) http.RoundTripper
- func Tracer(next http.RoundTripper) http.RoundTripper
- type Client
- type RoundTripper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpHttp ¶
func DumpHttp(level slog.Level) func(http.RoundTripper) http.RoundTripper
DumpHttp dumps the HTTP request and response, and prints out with logFunc.
func PanicCatcher ¶
func PanicCatcher(next http.RoundTripper) http.RoundTripper
PanicCatcher handles panics in http.RoundTripper.
func RoundTripperSequencer ¶
func RoundTripperSequencer(baseRoundTripper http.RoundTripper, rts ...func(http.RoundTripper) http.RoundTripper) http.RoundTripper
RoundTripperSequencer chains http.RoundTrippers in a chain.
func Timer ¶
func Timer(level slog.Level) func(http.RoundTripper) http.RoundTripper
Timer measures the time taken by http.RoundTripper.
func Tracer ¶ added in v0.2.0
func Tracer(next http.RoundTripper) http.RoundTripper
Tracer adds trace ID to the request context.
Types ¶
type Client ¶
type RoundTripper ¶
The RoundTripper type is an adapter to allow the use of ordinary functions as HTTP round trippers. If f is a function with the appropriate signature, Func(f) is a RoundTripper that calls f.
Click to show internal directories.
Click to hide internal directories.