Documentation
¶
Index ¶
- Constants
- func GetResults() []string
- type ResultError
- type RuleGroup
- type Spec
- type StatsResponse
- type Status
- type WAFController
- func (waf *WAFController) Category() supervisor.ObjectCategory
- func (waf *WAFController) Close()
- func (waf *WAFController) DefaultSpec() interface{}
- func (waf *WAFController) Handle(ctx *context.Context, ruleGroupName string) string
- func (waf *WAFController) Inherit(superSpec *supervisor.Spec, previousGeneration supervisor.Object)
- func (waf *WAFController) Init(superSpec *supervisor.Spec)
- func (waf *WAFController) Kind() string
- func (waf *WAFController) Status() *supervisor.Status
- type WAFHandler
Constants ¶
View Source
const ( // APIGroupName is the name of the WAF API group. APIGroupName = "waf" // APIPrefix is the prefix for WAF API endpoints. APIPrefix = "/waf" )
View Source
const ( // Category is the category of the WAFController. Category = supervisor.CategoryBusinessController // Kind is the kind of the WAFController. Kind = "WAFController" // ResultRuleGroupNotFoundError indicates that the rule group was not found. ResultRuleGroupNotFoundError ResultError = "ruleGroupNotFoundError" )
Variables ¶
This section is empty.
Functions ¶
func GetResults ¶
func GetResults() []string
Types ¶
type ResultError ¶
type ResultError string
type RuleGroup ¶
type RuleGroup interface {
Name() string
// Handle processes the request and returns a WAF response.
// TODO: how to handle the response?
// TODO: should we process the stream request and stream response?
Handle(ctx *context.Context) *protocol.WAFResult
Close()
}
RuleGroup defines the interface for a WAF rule group.
type Spec ¶
type Spec struct {
RuleGroups []*protocol.RuleGroupSpec `json:"ruleGroups" jsonschema:"required"`
}
Spec is the specification for WAFController.
type StatsResponse ¶
type StatsResponse struct {
Stats []*metrics.MetricStats `json:"stats"`
}
type WAFController ¶
type WAFController struct {
// contains filtered or unexported fields
}
WAFController is the controller for WAF.
func GetGlobalWAFController ¶
func GetGlobalWAFController() (*WAFController, error)
func (*WAFController) Category ¶
func (waf *WAFController) Category() supervisor.ObjectCategory
Category returns the category of the WAFController.
func (*WAFController) Close ¶
func (waf *WAFController) Close()
Close closes the WAFController and releases resources.
func (*WAFController) DefaultSpec ¶
func (waf *WAFController) DefaultSpec() interface{}
DefaultSpec returns the default specification for WAFController.
func (*WAFController) Handle ¶
func (waf *WAFController) Handle(ctx *context.Context, ruleGroupName string) string
Handle processes the request and returns a WAF response.
func (*WAFController) Inherit ¶
func (waf *WAFController) Inherit(superSpec *supervisor.Spec, previousGeneration supervisor.Object)
Inherit initializes the WAFController with the previous generation's specification.
func (*WAFController) Init ¶
func (waf *WAFController) Init(superSpec *supervisor.Spec)
Init initializes the WAFController with the provided supervisor specification.
func (*WAFController) Kind ¶
func (waf *WAFController) Kind() string
Kind returns the kind of the WAFController.
func (*WAFController) Status ¶
func (waf *WAFController) Status() *supervisor.Status
Status returns the status of the WAFController.
Click to show internal directories.
Click to hide internal directories.