Documentation ¶
Index ¶
- func Cors(corsOptions *models.CorsOptions, ...) func(http.ResponseWriter, *http.Request)
- func Metrics(name string, handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
- func NewLoggingResponseWriter(w http.ResponseWriter) *loggingResponseWriter
- func Recover(enabled bool, handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
- func RequestLogger(logger *logger.Logger, handler http.Handler) http.Handler
- func Version(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
- type MetricsRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cors ¶
func Cors(corsOptions *models.CorsOptions, handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
func Metrics ¶
func Metrics(name string, handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
Metrics returns the current metrics for the running API @Summary Get the current metrics for the running server @Tags Metrics @Description Gets the metrics like memory consumption & allocation as well as response time histograms to use with monitoring tools @ID metrics @Produce json @Success 200 {object} handlers.MetricsResponse @Router /metrics [get]
func NewLoggingResponseWriter ¶
func NewLoggingResponseWriter(w http.ResponseWriter) *loggingResponseWriter
func Recover ¶
func Recover(enabled bool, handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
func Version ¶ added in v0.2.0
func Version(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
Types ¶
type MetricsRegistry ¶
type MetricsRegistry struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.