Test webhook

This commit is contained in:
2025-10-10 20:48:35 +02:00
parent 23253eb06c
commit 6d88711576
3 changed files with 58 additions and 32 deletions

View File

@@ -7,11 +7,14 @@ import (
"os/signal"
logger "git.site.quack-lab.dev/dave/cylogger"
wh "go-eve-pi/webhook"
"github.com/fasthttp/router"
"github.com/valyala/fasthttp"
)
var webhook wh.Webhook
func main() {
flag.Parse()
logger.InitFlag()
@@ -27,6 +30,8 @@ func main() {
logger.Error("Failed to create SSO instance %v", err)
return
}
webhook = wh.NewZulipWebhook(options.ZulipURL, options.ZulipEmail, options.ZulipToken)
// Setup fasthttp router
r := router.New()
@@ -70,6 +75,10 @@ func main() {
}
}()
for i := 0; i < 10; i++ {
webhook.Post("eve-pi", "test", "test")
}
// Listen for SIGINT and gracefully shut down the server
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, os.Interrupt)