u_middleware

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = HttpLogOptions{
	Options: httplog.DefaultOptions,
	Body:    true,
}

Functions

func Handler

func Handler() func(next http.Handler) http.Handler

func NewHttpLogConfig

func NewHttpLogConfig(opts ...HttpLogOptions)

Types

type HttpLogMiddleware

type HttpLogMiddleware struct{}

func NewHttpLogMiddleware

func NewHttpLogMiddleware() *HttpLogMiddleware

func (*HttpLogMiddleware) Middleware

func (a *HttpLogMiddleware) Middleware() func(next http.Handler) http.Handler

type HttpLogOptions

type HttpLogOptions struct {
	httplog.Options
	//Log request and response bodies or not
	Body bool
}

type LogMiddleware

type LogMiddleware struct {
}

func NewLogMiddleware

func NewLogMiddleware() *LogMiddleware

func (*LogMiddleware) Middleware

func (a *LogMiddleware) Middleware() func(next http.Handler) http.Handler

type MetricMiddleware

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

func NewMetricMiddleware

func NewMetricMiddleware() *MetricMiddleware

func (*MetricMiddleware) Middleware

func (a *MetricMiddleware) Middleware() func(http.Handler) http.Handler

func (*MetricMiddleware) WithPrometheusHttpConfig

func (a *MetricMiddleware) WithPrometheusHttpConfig(conf *u_prometheus.HttpConfig) *MetricMiddleware

Jump to

Keyboard shortcuts

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