gzip

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 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 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 Driver

type Driver struct {
	// contains filtered or unexported fields
}

func (*Driver) Check

func (d *Driver) Check(v interface{}, workers map[eosc.RequireId]interface{}) error

func (*Driver) ConfigType

func (d *Driver) ConfigType() reflect.Type

func (*Driver) Create

func (d *Driver) Create(id, name string, v interface{}, workers map[eosc.RequireId]interface{}) (eosc.IWorker, error)

type Factory

type Factory struct {
}

func NewFactory

func NewFactory() *Factory

func (*Factory) Create

func (f *Factory) Create(profession string, name string, label string, desc string, params map[string]interface{}) (eosc.IExtenderDriver, error)

func (*Factory) Render added in v0.6.0

func (f *Factory) Render() interface{}

type Gzip

type Gzip struct {
	*Driver
	// 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 http_service.IHttpContext, next http_service.IChain) (err error)

func (*Gzip) Id

func (g *Gzip) Id() string

func (*Gzip) Reset

func (g *Gzip) Reset(conf interface{}, workers map[eosc.RequireId]interface{}) 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