hckit

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MPL-2.0 Imports: 12 Imported by: 4

README

go-hckit

Standard library of reusable abstractions.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitGlobalTracer

func InitGlobalTracer(service string) (io.Closer, error)

InitGlobalTracer sets the GlobalTracer to an instance of Jaeger Tracer that loads the Jaeger tracer from the environment, samples 100% of traces, and logs all spans to stdout.

func InjectHeaders

func InjectHeaders(r *http.Request)

InjectHeaders injects the necessary opentracing headers to support distributed tracing.

func TracingMiddleware

func TracingMiddleware(next http.Handler) http.Handler

TracingMiddleware returns an HTTP Handler appropriate for Middleware chaining via Router.Use.

Types

type TracingRoundTripper

type TracingRoundTripper struct {
	Proxied http.RoundTripper
}

TracingRoundTripper implements the http.RoundTripper interface

func (TracingRoundTripper) RoundTrip

func (trt TracingRoundTripper) RoundTrip(req *http.Request) (res *http.Response, e error)

RoundTrip injects tracing headers to outbound request. TODO: Find a way to make registration less manual.

Jump to

Keyboard shortcuts

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