middleware

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 5, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(handler http.Handler, store store.Store, logRequestBody, logResponseBody bool, pathMatcher PathMatcher) http.Handler

Wrap wraps an http.Handler with the request visualization middleware

Types

type OTelMiddleware added in v0.1.3

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

OTelMiddleware wraps an http.Handler with OpenTelemetry instrumentation

func NewOTelMiddleware added in v0.1.3

func NewOTelMiddleware(handler http.Handler, serviceName, serviceVersion string) *OTelMiddleware

NewOTelMiddleware creates a new OpenTelemetry middleware

func (*OTelMiddleware) ServeHTTP added in v0.1.3

func (m *OTelMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface

type PathMatcher

type PathMatcher interface {
	ShouldIgnorePath(path string) bool
}

PathMatcher defines an interface for checking if a path should be ignored

Jump to

Keyboard shortcuts

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