middleware

package
v1.9.14 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Component = &app.Component{
	Dependencies: app.Components{
		logger.Component,
		client.Component,
	},
	Run: app.Run(func(container container.Container) error {
		return container.Invoke(func(httpClient client.Doer, appConfig *app.Config, logger logger.Logger) {
			httpClient.Use(
				RequestLogger(logger),
				RequestDuration(appConfig, logger),
				TotalRequestCount(appConfig, logger),
			)
		})
	}),
}

Functions

func NewRequestDurationMetric

func NewRequestDurationMetric(originalTransport http.RoundTripper, metric *prometheus.HistogramVec) http.RoundTripper

func NewRequestDurationMetricNoEndpoint added in v1.9.14

func NewRequestDurationMetricNoEndpoint(originalTransport http.RoundTripper, metric *prometheus.HistogramVec) http.RoundTripper

func NewRequestLogger

func NewRequestLogger(originalTransport http.RoundTripper, logger logger.Logger) http.RoundTripper

func NewResponseLogger added in v1.8.12

func NewResponseLogger(originalTransport http.RoundTripper, logger logger.Logger) http.RoundTripper

func NewTotalRequestCountMetric

func NewTotalRequestCountMetric(originalTransport http.RoundTripper, metric *prometheus.CounterVec) http.RoundTripper

func NewTotalRequestCountMetricNoEndpoint added in v1.9.14

func NewTotalRequestCountMetricNoEndpoint(originalTransport http.RoundTripper, metric *prometheus.CounterVec) http.RoundTripper

func RequestDuration

func RequestDuration(appConfig *app.Config, informer logger.Informer) client.MiddlewareFunc

func RequestDurationNoEndpoint added in v1.9.14

func RequestDurationNoEndpoint(appConfig *app.Config, informer logger.Informer) client.MiddlewareFunc

func RequestLogger

func RequestLogger(logger logger.Logger) client.MiddlewareFunc

func ResponseLogger added in v1.8.12

func ResponseLogger(logger logger.Logger) client.MiddlewareFunc

func TotalRequestCount

func TotalRequestCount(appConfig *app.Config, informer logger.Informer) client.MiddlewareFunc

func TotalRequestCountNoEndpoint added in v1.9.14

func TotalRequestCountNoEndpoint(appConfig *app.Config, informer logger.Informer) client.MiddlewareFunc

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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