Documentation
¶
Overview ¶
Package compress 提供一个支持内容压缩的中间件
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Compress ¶
type Compress struct {
// contains filtered or unexported fields
}
Compress 提供压缩功能的中件间
func New ¶
New 构建一个支持压缩的中间件
types 表示需要进行压缩处理的 mimetype 类型,可以是以下格式:
- application/json 具体类型;
- text* 表示以 text 开头的所有类型;
- * 表示所有类型,一旦指定此值,则其它设置都将被忽略;
func (*Compress) Middleware ¶
Middleware 将当前中间件应用于 next
func (*Compress) MiddlewareFunc ¶
MiddlewareFunc 将当前中间件应用于 next
type WriterFunc ¶
type WriterFunc func(w io.Writer) (io.WriteCloser, error)
WriterFunc 定义了将一个 io.Writer 声明为具有压缩功能的 io.WriteCloser
Click to show internal directories.
Click to hide internal directories.