支持缓存压缩后的内容

This commit is contained in:
GoEdgeLab
2022-02-22 19:29:27 +08:00
parent 80908373d2
commit 2d7e78e0db
5 changed files with 202 additions and 24 deletions

View File

@@ -18,6 +18,11 @@ const (
var ErrNotSupportedContentEncoding = errors.New("not supported content encoding")
// AllEncodings 当前支持的所有编码
func AllEncodings() []ContentEncoding {
return []ContentEncoding{ContentEncodingBr, ContentEncodingGzip, ContentEncodingDeflate}
}
// NewReader 获取Reader
func NewReader(reader io.Reader, contentEncoding ContentEncoding) (Reader, error) {
switch contentEncoding {