Documentation ¶
Overview ¶
Package compression provides means to extract compressed data from net/http request and compress net/http response. Only gzip is supported.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressResponse ¶
CompressResponse is net/http middleware executing gzip compression is gzip is supported by client and response belongs to supported type.
func DecompressRequest ¶
DecompressRequest is net/http middleware extracting gzip-compressed requests.
Types ¶
type Compressor ¶
type Compressor struct { http.ResponseWriter // contains filtered or unexported fields }
A Compressor implements data compression using grip encoder.
func NewCompressor ¶
func NewCompressor(w http.ResponseWriter, logger *zerolog.Logger) *Compressor
NewCompressor creatse new Compressor instance.
func (*Compressor) Close ¶
func (c *Compressor) Close()
Close dumps internal buffers and finishes compression. Must be called before end of response processing, otherwise part of data can be lost.
Click to show internal directories.
Click to hide internal directories.