middleware

package
v0.0.0-...-1560926 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(tokenAuth *jwtauth.JWTAuth, isProtected func(*http.Request) bool) func(next http.Handler) http.Handler

func NewCapturedResponseWriter

func NewCapturedResponseWriter(w http.ResponseWriter) *capturedResponseWriter

func NewSingleHostReverseProxy

func NewSingleHostReverseProxy(target *url.URL) *httputil.ReverseProxy

func ProxyFallback

func ProxyFallback(upstreamHost string, forwardToProxy func(int) bool, proxiedResponseCb func(*http.Response)) func(next http.Handler) http.Handler

func RequireUserAgent

func RequireUserAgent(next http.Handler) http.Handler

func StatisticsMiddleware

func StatisticsMiddleware(stats *Statistics) func(next http.Handler) http.Handler

Types

type Statistics

type Statistics struct {
	ActiveConnections       int
	TotalConnections        int
	TotalResponseTime       time.Duration
	ConnectionsPerEndpoint  map[string]int
	ResponseTimePerEndpoint map[string]time.Duration
	Mutex                   sync.Mutex
}

func NewStatistics

func NewStatistics() *Statistics

type UserAgentNotSetResponse

type UserAgentNotSetResponse struct {
	Message string   `json:"message,omitempty"`
	Errors  []string `json:"errors,omitempty"`
}

Jump to

Keyboard shortcuts

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