middlewares

package
v0.3.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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 RequestLogger

func RequestLogger(logger *logger.Logger, handler http.Handler) http.Handler

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL