Documentation ¶
Overview ¶
Package compress 提供一个支持内容压缩的中间件
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Compress ¶ added in v1.7.0
type Compress struct {
// contains filtered or unexported fields
}
Compress 提供压缩功能的中件间
type Options ¶
type Options struct { // Funcs 指定压缩名称对应的生成函数 Funcs map[string]WriterFunc // 如果指定了这个值,那么会把错误日志输出到此。 // 若未指定,则不输出内容。 ErrorLog *log.Logger // 仅对该表中的类型进行压缩 // // 可以用通配符 * 作为结尾: // text* 表示以 text 开头的 mimetype; // 其它类型的值,表示完全匹配。 Types []string // contains filtered or unexported fields }
Options New 的参数
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.