notify.webhooks sends signed JSON or Slack-compatible messages, queued, retried, de-duplicated hourly; ctl notify test checks each webhook. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
20 lines
557 B
Go
20 lines
557 B
Go
package adminapi
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"gitea.mynodes.xyz/ilker/llmgw/internal/notify"
|
|
)
|
|
|
|
// SetNotifier gives the API the webhooks `ctl notify test` reaches.
|
|
func (a *API) SetNotifier(n *notify.Notifier) { a.notifier = n }
|
|
|
|
// notifyTest sends a test event to every webhook and says how each answered.
|
|
func (a *API) notifyTest(w http.ResponseWriter, r *http.Request) {
|
|
if a.notifier == nil {
|
|
writeError(w, http.StatusNotFound, "no webhooks: server.yaml has no notify.webhooks")
|
|
return
|
|
}
|
|
writeJSON(w, http.StatusOK, a.notifier.Test(r.Context()))
|
|
}
|