mod_errors

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RETURN   = "RETURN"
	REDIRECT = "REDIRECT"
)
View Source
const (
	MaxPageSize = 2 * 1024 * 1024
)

Variables

This section is empty.

Functions

func ActionFileCheck

func ActionFileCheck(conf ActionFile) error

ActionFileCheck check ActionFile, return nil if check ok

func ActionFileListCheck

func ActionFileListCheck(actionList *ActionFileList) error

ActionFileListCheck check ActionFileList, return nil if check ok

func ErrorsActionsDo

func ErrorsActionsDo(req *bfe_basic.Request, actions []Action)

func ErrorsConfCheck

func ErrorsConfCheck(conf ErrorsConfFile) error

ErrorsConfCheck check ErrorsConf

func ErrorsRuleCheck

func ErrorsRuleCheck(conf ErrorsRuleFile) error

ErrorsRuleCheck check errors rule

func ProductRulesCheck

func ProductRulesCheck(conf *ProductRulesFile) error

ProductRulesCheck check ProductRules

func RuleListCheck

func RuleListCheck(conf *RuleFileList) error

RuleListCheck check RuleList

Types

type Action

type Action struct {
	Cmd string // command of action

	// for RETURN action
	StatusCode  int    // status code
	ContentType string // content type
	ContentData string // content data

	// for REDIRECT action
	RedirectUrl string
}

type ActionFile

type ActionFile struct {
	Cmd    *string  // command of action
	Params []string // params of action
}

type ActionFileList

type ActionFileList []ActionFile

type ConfModErrors

type ConfModErrors struct {
	Basic struct {
		DataPath string // path of config data
	}

	Log struct {
		OpenDebug bool
	}
}

func ConfLoad

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

ConfLoad load config from config file

func (*ConfModErrors) Check

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

type ErrorsConf

type ErrorsConf struct {
	Version string       // version of the config
	Config  ProductRules // product rules for errors
}

func ErrorsConfLoad

func ErrorsConfLoad(filename string) (ErrorsConf, error)

ErrorsConfLoad load errors config from file

type ErrorsConfFile

type ErrorsConfFile struct {
	Version *string // version of the config
	Config  *ProductRulesFile
}

type ErrorsRule

type ErrorsRule struct {
	Cond    condition.Condition // condition for errors
	Actions []Action            // list of actions
}

type ErrorsRuleFile

type ErrorsRuleFile struct {
	Cond    *string         // condition for errors
	Actions *ActionFileList // list of actions
}

type ErrorsRuleTable

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

func NewErrorsRuleTable

func NewErrorsRuleTable() *ErrorsRuleTable

func (*ErrorsRuleTable) Search

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

Search find rules for given product

func (*ErrorsRuleTable) Update

func (t *ErrorsRuleTable) Update(conf ErrorsConf)

type ModuleErrors

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

func NewModuleErrors

func NewModuleErrors() *ModuleErrors

func (*ModuleErrors) Init

func (*ModuleErrors) Name

func (m *ModuleErrors) Name() string

type ProductRules

type ProductRules map[string]*RuleList // product => list of errors rules

type ProductRulesFile

type ProductRulesFile map[string]*RuleFileList // product => list of errors rules

type RuleFileList

type RuleFileList []ErrorsRuleFile

type RuleList

type RuleList []ErrorsRule

Jump to

Keyboard shortcuts

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