middleware

package
v0.0.0-...-7ee3c9b Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CircuitBreaker

type CircuitBreaker struct {
	CircuitBreaker *gobreaker.CircuitBreaker
	Logger         zap.Logger
}

func NewCircuitBreaker

func NewCircuitBreaker(name string, maxRequest uint32, timeout time.Duration, interval time.Duration, readyToTrip func(counts gobreaker.Counts) bool, logger zap.Logger) *CircuitBreaker

func (CircuitBreaker) Handler

func (breaker CircuitBreaker) Handler(next http.Handler) http.Handler

type InstrumentationMiddleware

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

func NewInstrumentationMiddleware

func NewInstrumentationMiddleware(operationName string) *InstrumentationMiddleware

func (*InstrumentationMiddleware) Handler

type LoggingMiddleware

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

func NewLoggingMiddleware

func NewLoggingMiddleware(logger *zap.Logger) *LoggingMiddleware

func (*LoggingMiddleware) Handler

func (m *LoggingMiddleware) Handler(next http.Handler) http.Handler

type PanicRecovery

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

func NewPanicRecovery

func NewPanicRecovery(logger zap.Logger) *PanicRecovery

func (*PanicRecovery) Handler

func (panic *PanicRecovery) Handler(next http.Handler) http.Handler

type PrometheusMiddleware

type PrometheusMiddleware struct {
	Histogram *prometheus.HistogramVec
	Counter   *prometheus.CounterVec
}

func NewPrometheusMiddleware

func NewPrometheusMiddleware() *PrometheusMiddleware

func (*PrometheusMiddleware) Handler

func (p *PrometheusMiddleware) Handler(next http.Handler) http.Handler

Metrics godoc @Summary Prometheus metrics @Description returns HTTP requests duration and Go runtime metrics @Tags Kubernetes @Produce plain @Router /metrics [get] @Success 200 {string} string "OK"

type RateLimit

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

func NewRateLimitMiddleware

func NewRateLimitMiddleware(rateLimit rate.Limit, rateBurst int) *RateLimit

func (*RateLimit) Handler

func (rateLimit *RateLimit) Handler(next http.Handler) http.Handler

type ZipkinTracer

type ZipkinTracer struct {
	OperationName string
	Tracer        *zipkin.Tracer
}

func NewZipKinTracerMiddleware

func NewZipKinTracerMiddleware(operationName string, tracer *zipkin.Tracer) *ZipkinTracer

func (*ZipkinTracer) Handler

func (tracer *ZipkinTracer) Handler(next http.Handler) http.Handler

Jump to

Keyboard shortcuts

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