(mux *http.ServeMux, store event.Store, mod *Module)
| 37 | } |
| 38 | |
| 39 | func 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 |
no test coverage detected