o11ynethttp

package
v1.0.10299-90a7b94 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package o11ynethttp contains middleware for the standard Go HTTP server.

Package o11ynethttp provides common http middleware for tracing requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(provider o11y.Provider, name string, handler http.Handler) http.Handler

Middleware returns an http.Handler which wraps an http.Handler and adds an o11y.Provider to the context. A new span is created from the request headers.

This code is based on github.com/beeline-go/wrappers/hnynethttp/nethttp.go

Types

type RouteRecorder

type RouteRecorder struct {
	// contains filtered or unexported fields
}

func GetRouteRecorderFromContext

func GetRouteRecorderFromContext(ctx context.Context) *RouteRecorder

func NewRouteRecorder

func NewRouteRecorder() *RouteRecorder

func (*RouteRecorder) Route

func (r *RouteRecorder) Route() string

func (*RouteRecorder) SetRoute

func (r *RouteRecorder) SetRoute(route string)

Jump to

Keyboard shortcuts

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