Documentation
¶
Index ¶
- Constants
- Variables
- func ActionFileCheck(conf *ActionFile) error
- func ConfModBlockCheck(cfg *ConfModBlock, confRoot string) error
- func GlobalIPTableLoad(path string) (*ipdict.IPItems, error)
- func ProductRuleConfLoad(filename string) (productRuleConf, error)
- type Action
- type ActionFile
- type BlockInfo
- type ConfModBlock
- type ModuleBlock
- type ModuleBlockState
- type ProductRuleTable
- type ProductRules
- type ProductRulesFile
Constants ¶
View Source
const ( ModBlock = "mod_block" CtxBlockInfo = "mod_block.block_info" )
Variables ¶
View Source
var (
ErrBlock = errors.New("BLOCK")
)
Functions ¶
func ActionFileCheck ¶
func ActionFileCheck(conf *ActionFile) error
func ConfModBlockCheck ¶
func ConfModBlockCheck(cfg *ConfModBlock, confRoot string) error
func GlobalIPTableLoad ¶
GlobalIPTableLoad loads global ip table.
func ProductRuleConfLoad ¶
ProductRuleConfLoad load block rule config from file.
Types ¶
type ActionFile ¶
type ConfModBlock ¶
type ConfModBlock struct { Basic struct { ProductRulePath string // path of product block rule data IPBlocklistPath string // path of ip blocklist data } Log struct { OpenDebug bool // whether open debug } }
func ConfLoad ¶
func ConfLoad(filePath string, confRoot string) (*ConfModBlock, error)
ConfLoad loads config from config file
func (*ConfModBlock) Check ¶
func (cfg *ConfModBlock) Check(confRoot string) error
type ModuleBlock ¶
type ModuleBlock struct {
// contains filtered or unexported fields
}
func NewModuleBlock ¶
func NewModuleBlock() *ModuleBlock
func (*ModuleBlock) Init ¶
func (m *ModuleBlock) Init(cbs *bfe_module.BfeCallbacks, whs *web_monitor.WebHandlers, cr string) error
func (*ModuleBlock) Name ¶
func (m *ModuleBlock) Name() string
type ModuleBlockState ¶
type ModuleBlockState struct { ConnTotal *metrics.Counter // all connnetion checked ConnAccept *metrics.Counter // connection passed ConnRefuse *metrics.Counter // connection refused ReqTotal *metrics.Counter // all request in ReqAccept *metrics.Counter // request accepted ReqRefuse *metrics.Counter // request refused WrongCommand *metrics.Counter // request with condition satisfied, but wrong command }
type ProductRuleTable ¶
type ProductRuleTable struct {
// contains filtered or unexported fields
}
func NewProductRuleTable ¶
func NewProductRuleTable() *ProductRuleTable
func (*ProductRuleTable) Search ¶
func (t *ProductRuleTable) Search(product string) (*blockRuleList, bool)
func (*ProductRuleTable) Update ¶
func (t *ProductRuleTable) Update(conf productRuleConf)
type ProductRules ¶
type ProductRules map[string]*blockRuleList
type ProductRulesFile ¶
type ProductRulesFile map[string]*blockRuleFileList // product => list of block rules
Click to show internal directories.
Click to hide internal directories.