Documentation ¶
Overview ¶
Package routing contains the http.Handler routing logic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var MetricsDecorators = []Decorator{ CurryMeteringFactory[*prometheus.CounterVec](promhttp.InstrumentHandlerCounter, metrics.HTTPRequestsTotal), CurryMeteringFactory[prometheus.ObserverVec](promhttp.InstrumentHandlerDuration, metrics.HTTPRequestsDuration), CurryMeteringFactory[prometheus.ObserverVec](promhttp.InstrumentHandlerRequestSize, metrics.HTTPRequestsSize), CurryMeteringFactory[prometheus.ObserverVec](promhttp.InstrumentHandlerResponseSize, metrics.HTTPResponsesSize), }
Functions ¶
func ConfigureRoute ¶
ConfigureRoute configures a route using the provided configuration and validates it using the provided function.
Types ¶
type Decorator ¶
Decorator for a http request.
func CurryMeteringFactory ¶
func CurryMeteringFactory[O MeteringTarget[O], H http.Handler](fn MeterFactory[O, H], o O) Decorator
CurryMeteringFactory using the provided MeteringTarget and return a routing.Decorator from it.
type MeterFactory ¶
MeterFactory for generic creation of MetricsDecorators handlers.
type MeteringTarget ¶
type MeteringTarget[O any] interface { MustCurryWith(labels prometheus.Labels) O }
MeteringTarget allowing to curry labels.
Click to show internal directories.
Click to hide internal directories.