Documentation ¶
Overview ¶
`http_debug` adds /debug/request debugging information for HTTP requests.
Debug Wares ¶
This adds `/debug/request` information for client-side and server-side HTTP APIs.
This utilises the `x/net/trace` handlers that allow you to trace old requests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultIsStatusCodeAnError ¶
DefaultIsStatusCodeAnError defines a function that says whether a given request is an error based on a code.
func Middleware ¶
func Middleware(opts ...Option) httpwares.Middleware
Middleware returns a http.Handler middleware that writes inbound requests to /debug/request.
The data logged will be: request headers, request ctxtags, response headers and response length.
func Tripperware ¶
func Tripperware(opts ...Option) httpwares.Tripperware
Tripperware returns a piece of client-side Tripperware that puts requests on the `/debug/requests` page.
The data logged will be: request headers, request ctxtags, response headers and response length.
Types ¶
type FilterFunc ¶
FilterFunc allows users to provide a function that filters out certain methods from being traced.
If it returns false, the given request will not be traced.
type IsStatusCodeAnErrorFunc ¶
IsStatusCodeAnErrorFunc allows the customization of which requests are considered errors in the tracing system.
type Option ¶
type Option func(*options)
func WithFilterFunc ¶
func WithFilterFunc(f FilterFunc) Option
WithFilterFunc customizes the function used for deciding whether a given call is traced or not.
func WithIsStatusCodeAnError ¶
func WithIsStatusCodeAnError(f IsStatusCodeAnErrorFunc) Option
WithIsStatusCodeAnError customizes the function used for deciding whether a given call was an error