handler

package
v1.1.2-0...-f7e2eea Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorize

func Authorize(secret string, opts ...AuthorizeOption) func(http.Handler) http.Handler

func BreakerHandler

func BreakerHandler(method, path string, metrics *stat.Metrics) func(http.Handler) http.Handler

func ContentSecurityHandler

func ContentSecurityHandler(decrypters map[string]codec.RsaDecrypter, tolerance time.Duration,
	strict bool, callbacks ...UnsignedCallback) func(http.Handler) http.Handler

func CryptionHandler

func CryptionHandler(key []byte) func(http.Handler) http.Handler

func DetailedLogHandler

func DetailedLogHandler(next http.Handler) http.Handler

func GunzipHandler

func GunzipHandler(next http.Handler) http.Handler

func LogHandler

func LogHandler(next http.Handler) http.Handler

func MaxBytesHandler

func MaxBytesHandler(n int64) func(http.Handler) http.Handler

func MaxConns

func MaxConns(n int) func(http.Handler) http.Handler

func MetricHandler

func MetricHandler(metrics *stat.Metrics) func(http.Handler) http.Handler

func PromethousHandler

func PromethousHandler(path string) func(http.Handler) http.Handler

func RecoverHandler

func RecoverHandler(next http.Handler) http.Handler

func SheddingHandler

func SheddingHandler(shedder load.Shedder, metrics *stat.Metrics) func(http.Handler) http.Handler

func TimeoutHandler

func TimeoutHandler(duration time.Duration) func(http.Handler) http.Handler

func TracingHandler

func TracingHandler(next http.Handler) http.Handler

Types

type AuthorizeOption

type AuthorizeOption func(opts *AuthorizeOptions)

func WithPrevSecret

func WithPrevSecret(secret string) AuthorizeOption

func WithUnauthorizedCallback

func WithUnauthorizedCallback(callback UnauthorizedCallback) AuthorizeOption

type AuthorizeOptions

type AuthorizeOptions struct {
	PrevSecret string
	Callback   UnauthorizedCallback
}

type DetailLoggedResponseWriter

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

func (*DetailLoggedResponseWriter) Flush

func (w *DetailLoggedResponseWriter) Flush()

func (*DetailLoggedResponseWriter) Header

func (*DetailLoggedResponseWriter) Write

func (w *DetailLoggedResponseWriter) Write(bs []byte) (int, error)

func (*DetailLoggedResponseWriter) WriteHeader

func (w *DetailLoggedResponseWriter) WriteHeader(code int)

type LoggedResponseWriter

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

func (*LoggedResponseWriter) Flush

func (w *LoggedResponseWriter) Flush()

func (*LoggedResponseWriter) Header

func (w *LoggedResponseWriter) Header() http.Header

func (*LoggedResponseWriter) Write

func (w *LoggedResponseWriter) Write(bytes []byte) (int, error)

func (*LoggedResponseWriter) WriteHeader

func (w *LoggedResponseWriter) WriteHeader(code int)

type UnauthorizedCallback

type UnauthorizedCallback func(w http.ResponseWriter, r *http.Request, err error)

type UnsignedCallback

type UnsignedCallback func(w http.ResponseWriter, r *http.Request, next http.Handler, strict bool, code int)

Jump to

Keyboard shortcuts

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