feat(drivers): 饭碗警告(WIP)

This commit is contained in:
mei
2026-07-29 11:24:23 +08:00
parent 4a61527952
commit 9220cf82aa
8 changed files with 125 additions and 2 deletions
+21
View File
@@ -0,0 +1,21 @@
package fwalert
import (
"fmt"
"github.com/go-resty/resty/v2"
)
// send 发送消息
func send(config *FwAlertRuleConfig) error {
restyClient := resty.New()
req := restyClient.R()
resp, err := req.Execute("GET", config.WebhookURL+"?message="+config.Msg)
if err != nil {
return err
}
if resp.StatusCode() != 200 {
return fmt.Errorf("发送饭碗警告失败: %s", resp.Status())
}
return nil
}