mod_compress

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionGzip   = "GZIP"
	ActionBrotli = "BROTLI"
)
View Source
const (
	// support encode type of Accept-Encoding header
	EncodeGzip   = "gzip"
	EncodeBrotli = "br"

	// support encode type of Content-Encoding header
	EncodeIdentity = "identity"

	ModCompress = "mod_compress"
)

Variables

This section is empty.

Functions

func ActionFileCheck

func ActionFileCheck(conf *ActionFile) error

func ProductRuleConfLoad

func ProductRuleConfLoad(filename string) (productRuleConf, error)

Types

type Action

type Action struct {
	Cmd       string
	Quality   int
	FlushSize int
}

type ActionFile

type ActionFile struct {
	Cmd       *string
	Quality   *int
	FlushSize *int
}

type BrotliFilter

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

func NewBrotliFilter

func NewBrotliFilter(source io.ReadCloser, level int, size int) (b *BrotliFilter, err error)

func (*BrotliFilter) Close

func (b *BrotliFilter) Close() error

func (*BrotliFilter) Read

func (b *BrotliFilter) Read(p []byte) (n int, err error)

type CompressRuleTable

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

func NewCompressRuleTable

func NewCompressRuleTable() *CompressRuleTable

func (*CompressRuleTable) Search

func (t *CompressRuleTable) Search(product string) (*compressRuleList, bool)

func (*CompressRuleTable) Update

func (t *CompressRuleTable) Update(conf productRuleConf)

type ConfModCompress

type ConfModCompress struct {
	Basic struct {
		ProductRulePath string
	}

	Log struct {
		OpenDebug bool
	}
}

func ConfLoad

func ConfLoad(filePath string, confRoot string) (*ConfModCompress, error)

func (*ConfModCompress) Check

func (cfg *ConfModCompress) Check(confRoot string) error

type GzipFilter

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

func NewGzipFilter

func NewGzipFilter(source io.ReadCloser, level int, size int) (b *GzipFilter, err error)

func (*GzipFilter) Close

func (b *GzipFilter) Close() error

func (*GzipFilter) Read

func (b *GzipFilter) Read(p []byte) (n int, err error)

type ModuleCompress

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

func NewModuleCompress

func NewModuleCompress() *ModuleCompress

func (*ModuleCompress) Init

func (*ModuleCompress) Name

func (m *ModuleCompress) Name() string

type ModuleCompressState

type ModuleCompressState struct {
	ReqTotal              *metrics.Counter
	ReqSupportCompress    *metrics.Counter
	ReqMatchCompressRule  *metrics.Counter
	ResEncodeCompress     *metrics.Counter
	ResEncodeGzipCompress *metrics.Counter
	ResEncodeBrCompress   *metrics.Counter
}

type ProductRules

type ProductRules map[string]*compressRuleList

type ProductRulesFile

type ProductRulesFile map[string]*compressRuleFileList

Jump to

Keyboard shortcuts

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