ginhttp

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2020 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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

func MWComponentName(componentName string) MWOption

MWComponentName returns a MWOption that sets the component name for the server-side span.

func MWLogResponse

func MWLogResponse(b bool) MWOption

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

func MWURLTagFunc(f func(u *url.URL) string) MWOption

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.

func OperationNameFunc

func OperationNameFunc(f func(r *http.Request) string) MWOption

OperationNameFunc returns a MWOption that uses given function f to generate operation name for each server-side span.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL