Documentation
¶
Index ¶
- func ChainHandlers(handlers ...func(http.Handler) http.Handler) (handler http.Handler)
- func ContextHandler(h http.Handler) http.Handler
- func HTTPToHTTPSRedirectHandler(w http.ResponseWriter, r *http.Request)
- func MaxBodyBytesHandler(h http.Handler, size int64, body string, contentType string) http.Handler
- func MethodHandler(h map[string]http.Handler, body string, contentType string, ...)
- func NoCacheHeadersHandler(h http.Handler) http.Handler
- func NoExpireHeadersHandler(h http.Handler) http.Handler
- func SetHeadersHandler(h http.Handler, headers *map[string]string) http.Handler
- func StaticFilesHandler(h http.Handler, prefix string, fs http.FileSystem) http.Handler
- type BasicAuthHandler
- type ContextResponseWriter
- type DebugIndexHandler
- type IPAccessHandler
- type KeyAuth
- type TCPKeepAliveListener
- type TLSListener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChainHandlers ¶
func HTTPToHTTPSRedirectHandler ¶
func HTTPToHTTPSRedirectHandler(w http.ResponseWriter, r *http.Request)
func MaxBodyBytesHandler ¶
func MethodHandler ¶
func SetHeadersHandler ¶
func StaticFilesHandler ¶
Types ¶
type BasicAuthHandler ¶
type BasicAuthHandler struct {
Handler http.Handler
ErrorHandler func(w http.ResponseWriter, r *http.Request, err error)
ValidateFunc func(r *http.Request, username, password string) (rr *http.Request, valid bool, err error)
AuthorizeAll bool
AuthorizedNetworks []net.IPNet
BasicAuthRealm string
Logger *log.Logger
}
func (BasicAuthHandler) ServeHTTP ¶
func (h BasicAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ContextResponseWriter ¶
type ContextResponseWriter struct {
http.ResponseWriter
context.Context
}
func (*ContextResponseWriter) CloseNotify ¶
func (r *ContextResponseWriter) CloseNotify() <-chan bool
func (*ContextResponseWriter) Flush ¶
func (r *ContextResponseWriter) Flush()
func (*ContextResponseWriter) Header ¶
func (r *ContextResponseWriter) Header() http.Header
type DebugIndexHandler ¶
type DebugIndexHandler struct {
Path string
}
DebugIndexHandler serves pprof profiles under a defined Path. Path must end with the slash "/".
func (DebugIndexHandler) ServeHTTP ¶
func (h DebugIndexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves http request.
type IPAccessHandler ¶
func (IPAccessHandler) ServeHTTP ¶
func (h IPAccessHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type KeyAuth ¶
type TCPKeepAliveListener ¶
type TCPKeepAliveListener struct {
*net.TCPListener
}
type TLSListener ¶
type TLSListener struct {
*net.TCPListener
TLSConfig *tls.Config
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.