api

package
v0.0.0-...-6b39e2e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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

func MessageCtx(next http.Handler) http.Handler

MessageCtx enriches the request context with the requested message

func NewAPIRouter

func NewAPIRouter() http.Handler

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

func RateLimit(next http.Handler) http.Handler

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL