mod_static

package
v1.8.8 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 21 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 (
	EncodeGzip   = "gzip"
	EncodeBrotil = "br"
)
View Source
const (
	FileExtensionGzip   = "gz"
	FileExtensionBrotil = "br"
)
View Source
const (
	ActionBrowse = "BROWSE"
)
View Source
const (
	ModStatic = "mod_static"
)

Variables

This section is empty.

Functions

func ActionFileCheck

func ActionFileCheck(conf *ActionFile) error

func CheckAcceptEncoding

func CheckAcceptEncoding(req *bfe_http.Request) []string

func ConvertEncodeToExt

func ConvertEncodeToExt(encoding string) string

func MimeTypeConfCheck

func MimeTypeConfCheck(mimeTypeConf MimeTypeConf) error

func MimeTypeConfConvert

func MimeTypeConfConvert(mimeTypeConf *MimeTypeConf)

func ProductRulesCheck

func ProductRulesCheck(conf *ProductRulesFile) error

func RuleListCheck

func RuleListCheck(conf *RuleFileList) error

func StaticConfCheck

func StaticConfCheck(conf StaticConfFile) error

func StaticRuleCheck

func StaticRuleCheck(conf StaticRuleFile) error

Types

type Action

type Action struct {
	Cmd    string
	Params []string
}

type ActionFile

type ActionFile struct {
	Cmd    *string
	Params []string
}

type ConfModStatic

type ConfModStatic struct {
	Basic struct {
		DataPath       string
		MimeTypePath   string
		EnableCompress bool
	}

	Log struct {
		OpenDebug bool
	}
}

func ConfLoad

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

func (*ConfModStatic) Check

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

type MimeType

type MimeType map[string]string

type MimeTypeConf

type MimeTypeConf struct {
	Version string
	Config  MimeType
}

func MimeTypeConfLoad

func MimeTypeConfLoad(filename string) (MimeTypeConf, error)

type MimeTypeTable

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

func NewMimeTypeTable

func NewMimeTypeTable() *MimeTypeTable

func (*MimeTypeTable) Search

func (t *MimeTypeTable) Search(key string) (string, bool)

func (*MimeTypeTable) Update

func (t *MimeTypeTable) Update(conf MimeTypeConf)

type ModuleStatic

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

func NewModuleStatic

func NewModuleStatic() *ModuleStatic

func (*ModuleStatic) Init

func (*ModuleStatic) Name

func (m *ModuleStatic) Name() string

type ModuleStaticState

type ModuleStaticState struct {
	FileBrowseSize             *metrics.Counter
	FileBrowseCount            *metrics.Counter
	FileBrowseNotExist         *metrics.Counter
	FileBrowseContentTypeError *metrics.Counter
	FileBrowseFallbackDefault  *metrics.Counter
	FileCurrentOpened          *metrics.Gauge
}

type ProductRules

type ProductRules map[string]*RuleList

type ProductRulesFile

type ProductRulesFile map[string]*RuleFileList

type RuleFileList

type RuleFileList []StaticRuleFile

type RuleList

type RuleList []StaticRule

type StaticConf

type StaticConf struct {
	Version string
	Config  ProductRules
}

func StaticConfLoad

func StaticConfLoad(filename string) (StaticConf, error)

type StaticConfFile

type StaticConfFile struct {
	Version *string
	Config  *ProductRulesFile
}

type StaticRule

type StaticRule struct {
	Cond   condition.Condition
	Action Action
}

type StaticRuleFile

type StaticRuleFile struct {
	Cond   string
	Action *ActionFile
}

type StaticRuleTable

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

func NewStaticRuleTable

func NewStaticRuleTable() *StaticRuleTable

func (*StaticRuleTable) Search

func (t *StaticRuleTable) Search(product string) (*RuleList, bool)

func (*StaticRuleTable) Update

func (t *StaticRuleTable) Update(conf StaticConf)

Jump to

Keyboard shortcuts

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