mod_compress

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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