Documentation
¶
Overview ¶
Copyright 2020 The Moov Authors Use of this source code is governed by an Apache License license that can be found in the LICENSE file.
Index ¶
- Variables
- func CleanPath(path string) string
- func HeaderUserID(r *http.Request) string
- func PathUserID(r *http.Request) string
- func PingRoute(logger log.Logger, r *mux.Router)
- func ReadLimit(r *http.Request) int64
- func ReadOffset(r *http.Request) int64
- func ReadPathID(name string, r *http.Request) string
- type Responder
Constants ¶
This section is empty.
Variables ¶
View Source
var ( IdempotentRecorder = lru.New() // Prometheus Metrics Histogram = prometheus.NewHistogramFrom(stdprometheus.HistogramOpts{ Name: "http_response_duration_seconds", Help: "Histogram representing the http response durations", }, []string{"route"}) )
Functions ¶
func CleanPath ¶
CleanPath takes a URL path and formats it for Prometheus metrics
This method replaces /'s with -'s and strips out moov/base.ID() values from URL path slugs.
func HeaderUserID ¶
HeaderUserID returns a wrapped UserID from an HTTP request's HTTP Headers
func PathUserID ¶
PathUserID returns a wrapped UserID from an HTTP request's URL path
func ReadOffset ¶
ReadOffset returns the "offset" query param from a request or zero if it's missing.
Types ¶
Click to show internal directories.
Click to hide internal directories.