Documentation ¶
Overview ¶
Package httpmiddleware contains HTTP middlewares.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Metrics ¶
type Metrics interface { TracerProvider() trace.TracerProvider MeterProvider() metric.MeterProvider TextMapPropagator() propagation.TextMapPropagator }
Metrics wraps TracerProvider and MeterProvider.
type Middleware ¶
Middleware is a net/http middleware.
func InjectLogger ¶
func InjectLogger(lg *zap.Logger) Middleware
InjectLogger injects logger into request context.
func Instrument ¶
func Instrument(serviceName string, find RouteFinder, m Metrics) Middleware
Instrument setups otelhttp.
func LogRequests ¶
func LogRequests(find RouteFinder) Middleware
LogRequests logs incoming requests using context logger.
type OgenServer ¶
OgenServer is a generic ogen server type.
type RouteFinder ¶
RouteFinder finds Route by given URL.
func MakeRouteFinder ¶
func MakeRouteFinder[R OgenRoute, S OgenServer[R]](server S) RouteFinder
MakeRouteFinder creates RouteFinder from given server.
Click to show internal directories.
Click to hide internal directories.