middleware

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger() echo.MiddlewareFunc

func LoggerWithConfig

func LoggerWithConfig(config LoggerConfig) echo.MiddlewareFunc

Types

type LoggerConfig

type LoggerConfig struct {
	Skipper middleware.Skipper
	// BlackListEndpoint is the list of endpoint that you don't want to log with the info level
	BlackListEndpoint []string
}

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

Metrics provides a way to monitor an API with a middleware to use

func NewMetrics

func NewMetrics(namespace string) (*Metrics, error)

func (*Metrics) Collect

func (m *Metrics) Collect(ch chan<- prometheus.Metric)

func (*Metrics) Describe

func (m *Metrics) Describe(ch chan<- *prometheus.Desc)

func (*Metrics) ProcessHTTPRequest

func (m *Metrics) ProcessHTTPRequest(next echo.HandlerFunc) echo.HandlerFunc

ProcessHTTPRequest is an echo middleware. It will intercept all responses. It will increase the metrics that count the number of HTTP request and calculate the time took to respond.

Jump to

Keyboard shortcuts

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