Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MetricsProvider ¶
type MetricsProvider struct { TracerProvider trace.TracerProvider MeterProvider metric.MeterProvider TextMapPropagator propagation.TextMapPropagator }
type Middleware ¶
Middleware is a net/http middleware.
func InjectLogger ¶
func InjectLogger(lg *slog.Logger) Middleware
InjectLogger injects logger into request context.
func Instrument ¶
func Instrument(serviceName string, find RouteFinder, m MetricsProvider) Middleware
Instrument setups otelhttp.
func Labeler ¶
func Labeler(find RouteFinder) Middleware
func LogRequests ¶
func LogRequests(find RouteFinder) Middleware
LogRequests logs incoming requests using context logger.
type RouteFinder ¶
RouteFinder finds Route by given URL.
func MakeRouteFinder ¶
func MakeRouteFinder[R Route, S Server[R]](server S) RouteFinder
MakeRouteFinder creates RouteFinder from given server.
Click to show internal directories.
Click to hide internal directories.