Improve rule actions

This commit is contained in:
世界 2024-11-06 17:30:40 +08:00
parent 4fe40fcee0
commit 313be3d7a4
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
10 changed files with 434 additions and 150 deletions

View file

@ -52,7 +52,7 @@ type RuleItem interface {
}
func NewDefaultRule(ctx context.Context, router adapter.Router, logger log.ContextLogger, options option.DefaultRule) (*DefaultRule, error) {
action, err := NewRuleAction(logger, options.RuleAction)
action, err := NewRuleAction(router, logger, options.RuleAction)
if err != nil {
return nil, E.Cause(err, "action")
}
@ -254,7 +254,7 @@ type LogicalRule struct {
}
func NewLogicalRule(ctx context.Context, router adapter.Router, logger log.ContextLogger, options option.LogicalRule) (*LogicalRule, error) {
action, err := NewRuleAction(logger, options.RuleAction)
action, err := NewRuleAction(router, logger, options.RuleAction)
if err != nil {
return nil, E.Cause(err, "action")
}