aboutsummaryrefslogtreecommitdiff
path: root/go.mod
diff options
context:
space:
mode:
authorGravatar Erik Dubbelboer <erik@dubbelboer.com> 2020-05-15 15:36:26 +0200
committerGravatar Erik Dubbelboer <erik@dubbelboer.com> 2020-05-15 15:36:26 +0200
commit339ad36634b68ab5b4d90fb9991e38d5020a1039 (patch)
tree167e613ce9b8eef1d3b92c18b00d4039cbc8df91 /go.mod
parentDon't wrap conn with a TLS Client if it's already a TLS Conn (diff)
downloadfasthttp-339ad36634b68ab5b4d90fb9991e38d5020a1039.tar.gz
fasthttp-339ad36634b68ab5b4d90fb9991e38d5020a1039.tar.bz2
fasthttp-339ad36634b68ab5b4d90fb9991e38d5020a1039.zip
Add Brotli support
New Functions: CompressHandlerBrotliLevel(h RequestHandler, brotliLevel, otherLevel int) RequestHandler Request.BodyUnbrotli() ([]byte, error) Response.BodyUnbrotli() ([]byte, error) AppendBrotliBytesLevel(dst, src []byte, level int) []byte WriteBrotliLevel(w io.Writer, p []byte, level int) (int, error) WriteBrotli(w io.Writer, p []byte) (int, error) AppendBrotliBytes(dst, src []byte) []byte WriteUnbrotli(w io.Writer, p []byte) (int, error) AppendUnbrotliBytes(dst, src []byte) ([]byte, error) New Constants: CompressBrotliNoCompression CompressBrotliBestSpeed CompressBrotliBestCompression CompressBrotliDefaultCompression Brotli compression levels are different from gzip/flate. Because of this we have separate level constants and CompressHandlerBrotliLevel takes 2 levels. I didn't add Brotli support to CompressHandler as this could cause a spike in CPU usage when users upgrade fasthttp. fasthttp.CompressBrotliDefaultCompression is not the same as brotli.DefaultCompression. brotli.DefaultCompression is more than twice as slow as fasthttp.CompressBrotliDefaultCompression which I thought was unreasonable as default.
Diffstat (limited to 'go.mod')
-rw-r--r--go.mod1
1 files changed, 1 insertions, 0 deletions
diff --git a/go.mod b/go.mod
index ba38c27..8ebfed6 100644
--- a/go.mod
+++ b/go.mod
@@ -3,6 +3,7 @@ module github.com/valyala/fasthttp
go 1.11
require (
+ github.com/andybalholm/brotli v1.0.0
github.com/klauspost/compress v1.10.4
github.com/valyala/bytebufferpool v1.0.0
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a