Documentation
¶
Index ¶
- func LabelerFromContext(ctx context.Context) (context.Context, *otelhttp.Labeler)
- type Handler
- type RecoverOption
- type RecoverOptions
- type RequestIDOption
- type RequestIDOptions
- type RoundTripper
- type RoundTripware
- func Dump() RoundTripware
- func DumpRequest() RoundTripware
- func DumpResponse() RoundTripware
- func Logger() RoundTripware
- func Metric(meter metric.Meter, name, description string) RoundTripware
- func Recover(opts ...RecoverOption) RoundTripware
- func RecoverWithOptions(opts RecoverOptions) RoundTripware
- func RequestID(opts ...RequestIDOption) RoundTripware
- func SessionID(opts ...SessionIDOption) RoundTripware
- func TrackingID(opts ...TrackingIDOption) RoundTripware
- type SessionIDGenerator
- type SessionIDOption
- type SessionIDOptions
- type TrackingIDGenerator
- type TrackingIDOption
- type TrackingIDOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LabelerFromContext ¶ added in v0.9.12
LabelerFromContext retrieves a Labeler instance from the provided context if one is available. If no Labeler was found in the provided context a new, empty Labeler is returned and the second return value is false. In this case it is safe to use the Labeler but any attributes added to it will not be used.
Types ¶
type RecoverOption ¶
type RecoverOption func(options *RecoverOptions)
func RecoverWithDisablePrintStack ¶
func RecoverWithDisablePrintStack(v bool) RecoverOption
RecoverWithDisablePrintStack roundTripware option
type RecoverOptions ¶
type RecoverOptions struct {
DisablePrintStack bool
}
func GetDefaultRecoverOptions ¶
func GetDefaultRecoverOptions() RecoverOptions
GetDefaultRecoverOptions returns the default options
type RequestIDOption ¶ added in v0.11.3
type RequestIDOption func(*RequestIDOptions)
func RequestIDWithHeader ¶ added in v0.11.3
func RequestIDWithHeader(v string) RequestIDOption
RequestIDWithHeader middleware option
func RequestIDWithProvider ¶ added in v0.11.4
func RequestIDWithProvider(v provider.RequestID) RequestIDOption
RequestIDWithProvider middleware option
type RequestIDOptions ¶ added in v0.11.3
func GetDefaultRequestIDOptions ¶ added in v0.11.3
func GetDefaultRequestIDOptions() RequestIDOptions
GetDefaultRequestIDOptions returns the default options
type RoundTripper ¶
type RoundTripper struct {
http.RoundTripper
// contains filtered or unexported fields
}
func NewRoundTripper ¶
func NewRoundTripper(l *zap.Logger, parent http.RoundTripper, roundTripwares ...RoundTripware) *RoundTripper
type RoundTripware ¶
func Dump ¶ added in v0.9.1
func Dump() RoundTripware
Dump returns a RoundTripper which prints out the request & response object
func DumpRequest ¶
func DumpRequest() RoundTripware
DumpRequest returns a RoundTripper which prints out the request object
func DumpResponse ¶
func DumpResponse() RoundTripware
DumpResponse returns a RoundTripper which prints out the response object
func Metric ¶ added in v0.9.12
func Metric(meter metric.Meter, name, description string) RoundTripware
Metric returns a RoundTripper which prints out the request & response object
func Recover ¶
func Recover(opts ...RecoverOption) RoundTripware
Recover returns a RoundTripper which catches any panics
func RecoverWithOptions ¶
func RecoverWithOptions(opts RecoverOptions) RoundTripware
RecoverWithOptions returns a RoundTripper which catches any panics
func RequestID ¶ added in v0.11.3
func RequestID(opts ...RequestIDOption) RoundTripware
RequestID returns a RoundTripper which prints out the request & response object
func SessionID ¶ added in v0.11.3
func SessionID(opts ...SessionIDOption) RoundTripware
SessionID returns a RoundTripper which prints out the request & response object
func TrackingID ¶ added in v0.11.3
func TrackingID(opts ...TrackingIDOption) RoundTripware
TrackingID returns a RoundTripper which prints out the request & response object
type SessionIDGenerator ¶ added in v0.11.3
type SessionIDGenerator func() string
type SessionIDOption ¶ added in v0.11.3
type SessionIDOption func(*SessionIDOptions)
func SessionIDWithHeader ¶ added in v0.11.3
func SessionIDWithHeader(v string) SessionIDOption
SessionIDWithHeader middleware option
type SessionIDOptions ¶ added in v0.11.3
type SessionIDOptions struct {
Header string
}
func GetDefaultSessionIDOptions ¶ added in v0.11.3
func GetDefaultSessionIDOptions() SessionIDOptions
GetDefaultSessionIDOptions returns the default options
type TrackingIDGenerator ¶ added in v0.11.3
type TrackingIDGenerator func() string
type TrackingIDOption ¶ added in v0.11.3
type TrackingIDOption func(*TrackingIDOptions)
func TrackingIDWithHeader ¶ added in v0.11.3
func TrackingIDWithHeader(v string) TrackingIDOption
TrackingIDWithHeader middleware option
type TrackingIDOptions ¶ added in v0.11.3
type TrackingIDOptions struct {
Header string
}
func GetDefaultTrackingIDOptions ¶ added in v0.11.3
func GetDefaultTrackingIDOptions() TrackingIDOptions
GetDefaultTrackingIDOptions returns the default options