Documentation ¶
Index ¶
- func Mid(tr opentracing.Tracer, trCfg *Config, opts ...MWOption) gin.HandlerFunc
- func Middleware(tr opentracing.Tracer, options ...MWOption) gin.HandlerFunc
- type Config
- type MWOption
- func MWComponentName(componentName string) MWOption
- func MWSpanFilter(f func(r *http.Request) bool) MWOption
- func MWSpanObserver(f func(span opentracing.Span, r *http.Request)) MWOption
- func MWURLTagFunc(f func(u *url.URL) string) MWOption
- func OperationNameFunc(f func(r *http.Request) string) MWOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Mid ¶
func Mid(tr opentracing.Tracer, trCfg *Config, opts ...MWOption) gin.HandlerFunc
func Middleware ¶
func Middleware(tr opentracing.Tracer, options ...MWOption) gin.HandlerFunc
Middleware is a gin native version of the equivalent middleware in:
https://github.com/opentracing-contrib/go-stdlib/
Types ¶
type MWOption ¶
type MWOption func(*mwOptions)
MWOption controls the behavior of the Middleware.
func MWComponentName ¶
MWComponentName returns a MWOption that sets the component name for the server-side span.
func MWSpanFilter ¶
MWSpanFilter returns a MWOption that filters requests from creating a span for the server-side span. Span won't be created if it returns false.
func MWSpanObserver ¶
func MWSpanObserver(f func(span opentracing.Span, r *http.Request)) MWOption
MWSpanObserver returns a MWOption that observe the span for the server-side span.
func MWURLTagFunc ¶
MWURLTagFunc returns a MWOption that uses given function f to set the span's http.url tag. Can be used to change the default http.url tag, eg to redact sensitive information.
Click to show internal directories.
Click to hide internal directories.