Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the core webhook processing engine.
func New ¶
func New(configs []*config.RuleConfig, log logger.LogWriter, logMode string, logRetention int, logMaxSizeMB int) *Engine
New creates a new Engine instance.
func (*Engine) CloseRuleLoggers ¶ added in v1.1.1
func (e *Engine) CloseRuleLoggers()
CloseRuleLoggers closes all rule-level loggers.
func (*Engine) Process ¶
func (e *Engine) Process(req *RequestData) []Response
Process handles an incoming webhook request by iterating all configs. Stops at the first matching rule (first match wins).
func (*Engine) ProcessTargeted ¶
func (e *Engine) ProcessTargeted(cfg *config.RuleConfig, req *RequestData) []Response
ProcessTargeted handles a webhook request for a specific config file (by filename).
func (*Engine) UpdateConfigs ¶
func (e *Engine) UpdateConfigs(configs []*config.RuleConfig)
UpdateConfigs replaces the engine's rule configs (for hot reload).
type RequestData ¶
type RequestData struct {
Headers map[string]string
Query map[string]string
Body map[string]interface{}
BodyRaw string
BodyBytes []byte // raw body bytes for HMAC signature verification
IP string
}
RequestData holds parsed request information.
func ParseRequest ¶
func ParseRequest(r *http.Request) (*RequestData, error)
ParseRequest extracts RequestData from an HTTP request. Returns an error if the request body exceeds the configured size limit.
Click to show internal directories.
Click to hide internal directories.