middlewares

package
Version: v0.0.0-...-cc4ef14 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GorillaMiddlewareFrom

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

func ResourceTypeFrom

func ResourceTypeFrom(path string) string

Types

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)

Directories

Path Synopsis
Code generated by pegomock.
Code generated by pegomock.

Jump to

Keyboard shortcuts

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