compress

package module
v0.0.0-...-648a86e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderAcceptEncoding  = "Accept-Encoding"
	HeaderContentEncoding = "Content-Encoding"
)

Variables

View Source
var (
	// AcceptAllEncodings 接受所有的编码格式
	AcceptAllEncodings = AcceptEncoding("zstd", "br", "gzip", "deflate", "snappy", "s2")
	// DefaultEncodings 默认接受所有的编码格式
	DefaultEncodings = AcceptEncoding("gzip", "deflate", "br")
)

Functions

This section is empty.

Types

type HeaderOption

type HeaderOption = func(headers http.Header) // 请求头处理

func AcceptEncoding

func AcceptEncoding(acceptEncodings ...string) HeaderOption

AcceptEncoding 接受编码

type Process

type Process = func(resp *http.Response) error // 响应处理器

func Decode

func Decode(next Process) Process

Decode 解压Body

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL