Back to godoc.org

Package middlewares

v0.0.0-...-cc4ef14
Latest Go to latest

The latest major version is .

Published: Mar 11, 2020 | License: Apache-2.0 | Module: github.com/cloudfoundry-incubator/bits-service

Index

func GorillaMiddlewareFrom

func GorillaMiddlewareFrom(negroniHandler negroni.Handler) func(next http.Handler) http.Handler

func ResourceTypeFrom

func ResourceTypeFrom(path string) string

type BasicAuthMiddleware

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

func NewBasicAuthMiddleWare

func NewBasicAuthMiddleWare(credentials ...Credential) *BasicAuthMiddleware

func (*BasicAuthMiddleware) ServeHTTP

func (middleware *BasicAuthMiddleware) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request, next http.HandlerFunc)

func (*BasicAuthMiddleware) WithBasicAuthHeaderMissingHandler

func (middleware *BasicAuthMiddleware) WithBasicAuthHeaderMissingHandler(handler http.Handler) *BasicAuthMiddleware

func (*BasicAuthMiddleware) WithUnauthorizedHandler

func (middleware *BasicAuthMiddleware) WithUnauthorizedHandler(handler http.Handler) *BasicAuthMiddleware

type BodySizeLimitMiddleware

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

func NewBodySizeLimitMiddleware

func NewBodySizeLimitMiddleware(bodySizeLimit uint64) *BodySizeLimitMiddleware

func (*BodySizeLimitMiddleware) ServeHTTP

func (middleware *BodySizeLimitMiddleware) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request, next http.HandlerFunc)

type Credential

type Credential struct {
	Username, Password string
}

type MetricsMiddleware

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

func NewMetricsMiddleware

func NewMetricsMiddleware(metricsService bitsgo.MetricsService) *MetricsMiddleware

func (*MetricsMiddleware) ServeHTTP

func (middleware *MetricsMiddleware) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request, next http.HandlerFunc)

type MultipartMiddleware

type MultipartMiddleware struct{}

func (*MultipartMiddleware) ServeHTTP

func (m *MultipartMiddleware) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request, next http.HandlerFunc)

This middleware is needed, because changing request contexts while passing request along different handlers creates new requests objects. So if we only call request.ParseMultipartForm at in the last handler, only that copy of the request contains the information about the temp files. By the time all the handlers return, and the server calls finishRequest(), that request does not contain the information about the temp files.

type PanicMiddleware

type PanicMiddleware struct{}

func (*PanicMiddleware) ServeHTTP

func (middleware *PanicMiddleware) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request, next http.HandlerFunc)

type SignatureVerificationMiddleware

type SignatureVerificationMiddleware struct {
	SignatureValidator pathsigner.PathSignatureValidator
}

func (*SignatureVerificationMiddleware) ServeHTTP

func (middleware *SignatureVerificationMiddleware) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request, next http.HandlerFunc)

type ZapLoggerMiddleware

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

func NewZapLoggerMiddleware

func NewZapLoggerMiddleware(logger *zap.SugaredLogger) *ZapLoggerMiddleware

func (*ZapLoggerMiddleware) ServeHTTP

func (middleware *ZapLoggerMiddleware) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request, next http.HandlerFunc)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier