25 lines
430 B
Go
Raw Normal View History

2024-05-08 01:56:48 +02:00
package main
import (
"strings"
2024-05-09 15:27:45 +02:00
"wazuh-notify/log"
2024-05-08 01:56:48 +02:00
"wazuh-notify/notification"
2024-05-09 15:27:45 +02:00
"wazuh-notify/services"
2024-05-08 01:56:48 +02:00
)
func main() {
2024-05-09 15:27:45 +02:00
inputParams := services.InitNotify()
2024-05-09 12:24:44 +02:00
2024-05-08 01:56:48 +02:00
for _, target := range strings.Split(inputParams.Targets, ",") {
switch target {
case "discord":
2024-05-09 15:27:45 +02:00
log.Log(target)
2024-05-08 01:56:48 +02:00
notification.SendDiscord(inputParams)
case "ntfy":
2024-05-09 15:27:45 +02:00
log.Log(target)
2024-05-08 01:56:48 +02:00
notification.SendNtfy(inputParams)
}
}
2024-05-09 23:34:39 +02:00
log.CloseLogFile()
2024-05-08 01:56:48 +02:00
}