Files
goodBaby/drivers/fwalert/runner.go
T

25 lines
496 B
Go
Raw Normal View History

2026-07-29 11:24:23 +08:00
package fwalert
import (
"context"
"github.com/ssdomei232/goodBaby/model"
)
// FwalertExecutor 饭碗警告执行器
type FwalertExecutor struct{}
func (e *FwalertExecutor) GetType() string {
2026-09-12 15:32:27 +08:00
return RuleType
2026-07-29 11:24:23 +08:00
}
2026-09-12 15:32:27 +08:00
func (e *FwalertExecutor) Execute(ctx context.Context, task *model.RuleTask) error {
// 饭碗警告的凭据就是 Webhook 地址,直接写在规则配置里
config, err := ParseRuleConfig(task.Rule.ConfigJson)
2026-07-29 11:24:23 +08:00
if err != nil {
return err
}
2026-09-12 15:32:27 +08:00
return Send(ctx, config)
2026-07-29 11:24:23 +08:00
}