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

Function registerSMTPAPI

modules/smtp/api.go:39–49  ·  view source on GitHub ↗
(mux *http.ServeMux, store event.Store, mod *Module)

Source from the content-addressed store, hash-verified

37}
38
39func registerSMTPAPI(mux *http.ServeMux, store event.Store, mod *Module) {
40 mux.HandleFunc("GET /api/smtp/cursor", handleCursor())
41 mux.HandleFunc("GET /api/smtp/stats", handleStats(store))
42 mux.HandleFunc("DELETE /api/smtp/messages", handleDeleteMessages(store))
43 // /wait must be registered before the plain /messages pattern.
44 mux.HandleFunc("GET /api/smtp/messages/wait", handleMessagesWait(store, mod))
45 mux.HandleFunc("GET /api/smtp/messages", handleMessages(store))
46 mux.HandleFunc("GET /api/smtp/message/{uuid}/raw", handleRaw(store))
47 mux.HandleFunc("GET /api/smtp/message/{uuid}/links", handleLinks(store))
48 mux.HandleFunc("GET /api/smtp/message/{uuid}/codes", handleCodes(store))
49}
50
51// handleCursor returns the current server time as a cursor token.
52// E2E tests grab the cursor before triggering an action, then pass it as

Callers 1

RegisterRoutesMethod · 0.85

Calls 8

handleCursorFunction · 0.85
handleStatsFunction · 0.85
handleDeleteMessagesFunction · 0.85
handleMessagesWaitFunction · 0.85
handleMessagesFunction · 0.85
handleRawFunction · 0.85
handleLinksFunction · 0.85
handleCodesFunction · 0.85

Tested by

no test coverage detected