MCPcopy
hub / github.com/PatchMon/PatchMon / GetStats

Method GetStats

server-source-code/internal/handler/alerts.go:48–55  ·  view source on GitHub ↗

GetStats handles GET /alerts/stats.

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

46
47// GetStats handles GET /alerts/stats.
48func (h *AlertsHandler) GetStats(w http.ResponseWriter, r *http.Request) {
49 stats, err := h.alerts.GetStats(r.Context())
50 if err != nil {
51 Error(w, http.StatusInternalServerError, "Failed to fetch alert stats")
52 return
53 }
54 successData(w, stats)
55}
56
57// GetAvailableActions handles GET /alerts/actions.
58func (h *AlertsHandler) GetAvailableActions(w http.ResponseWriter, r *http.Request) {

Callers 1

StatsMethod · 0.45

Calls 2

ErrorFunction · 0.85
successDataFunction · 0.85

Tested by

no test coverage detected