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.Logger) *Engine
New creates a new Engine instance.
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) ProcessAll ¶
func (e *Engine) ProcessAll(req *RequestData) []Response
ProcessAll iterates all configs and executes ALL matching rules (not just first match).
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
ParseRequest extracts RequestData from an HTTP request.
Click to show internal directories.
Click to hide internal directories.