Documentation ¶
Index ¶
- func JSONResponse(w http.ResponseWriter, d interface{}, c int)
- func MessageCtx(next http.Handler) http.Handler
- func NewAPIRouter() http.Handler
- func PostMessage(w http.ResponseWriter, r *http.Request)
- func RateLimit(next http.Handler) http.Handler
- func UpdateMessage(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONResponse ¶
func JSONResponse(w http.ResponseWriter, d interface{}, c int)
JSONResponse attempts to set the status code, c, and marshal the given interface, d, into a response that is written to the given ResponseWriter.
func MessageCtx ¶
MessageCtx enriches the request context with the requested message
func NewAPIRouter ¶
NewAPIRouter returns a new router that implements the healthcheck API
func PostMessage ¶
func PostMessage(w http.ResponseWriter, r *http.Request)
PostMessage creates and sends a new message with the provided configuration.
func RateLimit ¶
RateLimit is a function that limits requests to our POST endpoint by receiving domain. (TODO)
func UpdateMessage ¶
func UpdateMessage(w http.ResponseWriter, r *http.Request)
UpdateMessage updates the status for a particular message to indicate if it was received. It then returns a template with information on how to update the mail server settings to block future emails with the same configuration.
Types ¶
This section is empty.