middleware

package
v0.0.0-...-e4d1bf4 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const RequestIDHeaderName = "X-Request-ID"
View Source
const TenantIDHeaderName = "X-GreenSTAR-Tenant-ID"

Variables

This section is empty.

Functions

func AccessLogMiddleware

func AccessLogMiddleware(logSuccessfulRequests, excludeRemoteAddr bool, excludedHeaderPatterns []string, next http.Handler) http.Handler

func CORSMiddleware

func CORSMiddleware(
	allowedOrigins []string,
	allowedMethods []string,
	allowedHeaders []string,
	disableCredentials bool,
	exposeHeaders []string,
	maxAge time.Duration,
	next http.Handler) http.HandlerFunc

func CommonHeadersMiddleware

func CommonHeadersMiddleware(next http.Handler) http.Handler

func PostgresMiddleware

func PostgresMiddleware(pool *pgxpool.Pool, mode pgx.TxAccessMode, next http.Handler) http.Handler

func PreventCachingMiddleware

func PreventCachingMiddleware(next http.Handler) http.HandlerFunc

func RequestIDMiddleware

func RequestIDMiddleware(next http.Handler) http.HandlerFunc

func TenantIDMiddleware

func TenantIDMiddleware(next http.Handler) http.HandlerFunc

func TokenMiddleware

func TokenMiddleware(next http.Handler) http.HandlerFunc

func TraceMiddleware

func TraceMiddleware(next http.Handler) http.Handler

Types

type Handlers

type Handlers struct {
	OPTIONS http.Handler
	HEAD    http.Handler
	POST    http.Handler
	GET     http.Handler
	PUT     http.Handler
	PATCH   http.Handler
	DELETE  http.Handler
}

func (*Handlers) ServeHTTP

func (h *Handlers) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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