Documentation ¶
Overview ¶
Package gzip provides an HTTP handler which compresses responses if the client supports this, the response is compressable and not already compressed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGzipHandler ¶
NewGzipHandler wraps an existing handler to transparently gzip the response body if the client supports it (via the Accept-Encoding header) and the response Content-Type matches the contentTypes expression.
Types ¶
type GzipResponseWriter ¶
type GzipResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
func NewGzipResponseWriter ¶
func NewGzipResponseWriter(w http.ResponseWriter, contentTypes *regexp.Regexp) *GzipResponseWriter
func (*GzipResponseWriter) Close ¶
func (grw *GzipResponseWriter) Close()
func (*GzipResponseWriter) WriteHeader ¶
func (grw *GzipResponseWriter) WriteHeader(code int)
Click to show internal directories.
Click to hide internal directories.