middleware

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2018 License: MIT Imports: 17 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheControl

func CacheControl(age int) func(h httprouter.Handle) httprouter.Handle

func Compressor

func Compressor(h httprouter.Handle) httprouter.Handle

Compressor compress the response body if the header of request contained `Accept-Encoding`

func HMACSHA1Signer

func HMACSHA1Signer(hmacHeaderKey, nounceHeaderKey string, secret []byte) zin.Middleware

HMACSHA1Signer returns a middleware wrapper to add hmac signing string in response header

func Logger

func Recoverer

func Recoverer(h httprouter.Handle) httprouter.Handle

Types

type DeferWriter

type DeferWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func NewDeferWriter

func NewDeferWriter(w http.ResponseWriter) *DeferWriter

func (*DeferWriter) Bytes

func (w *DeferWriter) Bytes() []byte

func (*DeferWriter) Write

func (w *DeferWriter) Write(b []byte) (int, error)

func (*DeferWriter) WriteAll

func (w *DeferWriter) WriteAll()

type LoggerHandler

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

func LoggerH

func LoggerH(h http.Handler) LoggerHandler

func (LoggerHandler) ServeHTTP

func (lh LoggerHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ProxyWriter

type ProxyWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func NewProxyWriter

func NewProxyWriter(w http.ResponseWriter) *ProxyWriter

func (*ProxyWriter) Hijack

func (w *ProxyWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)

func (*ProxyWriter) Size

func (w *ProxyWriter) Size() int

func (*ProxyWriter) Status

func (w *ProxyWriter) Status() int

func (*ProxyWriter) Write

func (w *ProxyWriter) Write(b []byte) (int, error)

func (*ProxyWriter) WriteHeader

func (w *ProxyWriter) WriteHeader(s int)

type RecovererHandler

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

func RecovererH

func RecovererH(h http.Handler) RecovererHandler

func (*RecovererHandler) ServeHTTP

func (rh *RecovererHandler) 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