MCPcopy Create free account
hub / github.com/buggregator/server / handleDeleteMessages

Function handleDeleteMessages

modules/smtp/api.go:157–167  ·  view source on GitHub ↗

handleDeleteMessages purges SMTP messages, optionally filtered by project.

(store event.Store)

Source from the content-addressed store, hash-verified

155
156// handleDeleteMessages purges SMTP messages, optionally filtered by project.
157func handleDeleteMessages(store event.Store) http.HandlerFunc {
158 return func(w http.ResponseWriter, r *http.Request) {
159 project := r.URL.Query().Get("project")
160 opts := event.DeleteOptions{Type: "smtp", Project: project}
161 if err := store.DeleteAll(r.Context(), opts); err != nil {
162 smtpError(w, err.Error(), http.StatusInternalServerError)
163 return
164 }
165 smtpJSON(w, map[string]any{"status": true})
166 }
167}
168
169// handleStats returns count and last_received_at for SMTP messages.
170func handleStats(store event.Store) http.HandlerFunc {

Callers 1

registerSMTPAPIFunction · 0.85

Calls 4

smtpErrorFunction · 0.85
smtpJSONFunction · 0.85
DeleteAllMethod · 0.65
GetMethod · 0.45

Tested by

no test coverage detected