1 Star 1 Fork 1

海风/wxwork-bot

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
config.go 605 Bytes
Copy Edit Raw Blame History
海风 authored 2023-07-27 10:25 . 去掉: init() 函数
package src
import (
"encoding/json"
"os"
"github.com/sirupsen/logrus"
)
var botsKey = make(map[string]string)
const (
URL = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key="
OKMsg = "告警恢复"
AlertingMsg = "触发告警"
OK = "OK"
Alerting = "Alerting"
ColorGreen = "info"
ColorGray = "comment"
ColorRed = "warning"
)
func initEnv() {
bots := os.Getenv("bots")
if bots == "" {
logrus.Fatal("bot envirionment is not exists!")
}
err := json.Unmarshal([]byte(bots), &botsKey)
if err != nil {
logrus.Fatal("json error: ", err.Error())
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/haifengat/wxwork-bot.git
git@gitee.com:haifengat/wxwork-bot.git
haifengat
wxwork-bot
wxwork-bot
f7f54a03bae6

Search

D67c1975 1850385 1daf7b77 1850385