Documentation ¶
Overview ¶
package handler provides some support structs for http.servehttp.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressHandler ¶
CompressHandler gzip compresses HTTP responses for clients that support it via the 'Accept-Encoding' header.
func CompressHandlerLevel ¶
CompressHandlerLevel gzip compresses HTTP responses with specified compression level for clients that support it via the 'Accept-Encoding' header.
The compression level should be gzip.DefaultCompression, gzip.NoCompression, or any integer value between gzip.BestSpeed and gzip.BestCompression inclusive. gzip.DefaultCompression is used in case of invalid compression level.
Types ¶
type ErrHandler ¶
func (ErrHandler) ServeHTTP ¶
func (h ErrHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP allows our Handler type to satisfy http.Handler.
type StatusError ¶
func (StatusError) Error ¶
func (se StatusError) Error() string
func (StatusError) StatusCode ¶
func (se StatusError) StatusCode() int
Click to show internal directories.
Click to hide internal directories.