Package encoding contains Content-Encoding related filters.
Internal call graph ▹
Internal call graph ▾
In the call graph viewer below, each node is a function belonging to this package and its children are the functions it calls—perhaps dynamically.
The root nodes are the entry points of the package: functions that may be called from outside the package. There may be non-exported or anonymous functions among them if they are called dynamically from another package.
Click a node to visit that function's source code.
From there you can visit its callers by
clicking its declaring
Functions may be omitted if they were determined to be unreachable in the particular programs or tests that were analyzed.
func Gzip(next http.Handler) http.Handler
Gzip calls the next handler with a response writer that will compress the outbound writes with the default compression level. This filter assumes a chunked transfer encoding, so do not add a Content-Length header in the terminal handler.
If the request does not accept a gzip encoding, this filter has no effect.
func GzipTypes(mediaTypes string, next http.Handler) http.Handler
GzipTypes sets the gzips the response if the the request Accept-Encoding contains 'gzip' and the response 'Content-Type' contains one of the mediaTypes. When no or nil mediaTypes are provided, all content types will be gzip encoded.
func Gzipper(level int, mediaTypes ...string) func(http.Handler) http.Handler
Gzipper returns a composable middleware function that wraps a given http.Handler with outbound Gzip compression using the provided level and optional accepted media types.