gzip

package
v0.14.8 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "gzip"
)

Variables

View Source
var (
	ErrorMinLengthError = errors.New("the min_length field should > 0")
)

Functions

func Check added in v0.9.0

func Check(conf *Config, workers map[eosc.RequireId]eosc.IWorker) error

func Create added in v0.9.0

func Create(id, name string, conf *Config, workers map[eosc.RequireId]eosc.IWorker) (eosc.IWorker, error)

func NewFactory

func NewFactory() eosc.IExtenderDriverFactory

func Register

func Register(register eosc.IExtenderDriverRegister)

Types

type Config

type Config struct {
	Types     []string `json:"types" label:"content-type列表" description:"需要压缩的响应content-type类型列表"`
	MinLength int      `json:"min_length" label:"长度" description:"待压缩内容的最小长度" `
	Vary      bool     `json:"vary" label:"是否加上Vary头部"`
}

type Gzip

type Gzip struct {
	drivers.WorkerBase
	// contains filtered or unexported fields
}

func (*Gzip) CheckSkill

func (g *Gzip) CheckSkill(skill string) bool

func (*Gzip) Destroy

func (g *Gzip) Destroy()

func (*Gzip) DoFilter

func (g *Gzip) DoFilter(ctx eocontext.EoContext, next eocontext.IChain) (err error)

func (*Gzip) DoHttpFilter added in v0.8.0

func (g *Gzip) DoHttpFilter(ctx http_service.IHttpContext, next eocontext.IChain) (err error)

func (*Gzip) Reset

func (g *Gzip) Reset(conf interface{}, workers map[eosc.RequireId]eosc.IWorker) error

func (*Gzip) Start

func (g *Gzip) Start() error

func (*Gzip) Stop

func (g *Gzip) Stop() error

Jump to

Keyboard shortcuts

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