controller

package
v0.0.0-...-32823bc Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2017 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BatchController = func() interface{} {
	var Router = express.Router()
	Router.Post("/api/batch", BatchCreate)
	Router.Get("/api/batches", BatchList)
	Router.Get("/api/batch/:id", BatchIndex)
	Router.Get("/api/batch/:id/logs", BatchLogs)
	return *Router
}()
View Source
var LoginController = func() interface{} {
	var Router = express.Router()
	Router.Get("/api/login", LoginIndex)
	Router.Get("/api/login/oAuth", LoginVerify)
	return *Router
}()
View Source
var StatsController = func() interface{} {
	var Router = express.Router()
	Router.Get("/api/stats", GetStats)
	return *Router
}()
View Source
var UserController = func() interface{} {
	var Router = express.Router()
	Router.Get("/api/user", UserIndex)
	Router.Get("/api/user/logout", UserLogout)
	Router.Post("/api/user", UserUpdate)
	return *Router
}()
View Source
var WebhookController = func() interface{} {
	var Router = express.Router()
	Router.Post("/api/webhook/sendgrid", BatchUpdateSGStatus)
	Router.Post("/api/webhook/mailgun", BatchUpdateMGStatus)
	return *Router
}()

Functions

func BatchCreate

func BatchCreate(req *request.Request, res *response.Response, next func())

Create a new mail Batch for dispatch

func BatchIndex

func BatchIndex(req *request.Request, res *response.Response, next func())

Fetches data of a batch, provided the api_key

func BatchList

func BatchList(req *request.Request, res *response.Response, next func())

func BatchLogs

func BatchLogs(req *request.Request, res *response.Response, next func())

Retrieves all the logs associated to a batch, a batch can have multiple logs attached to it, each corresponding to a individual recipient

func BatchUpdateMGStatus

func BatchUpdateMGStatus(req *request.Request, res *response.Response, next func())

MailGun Webhook Mailgun service only provides delivered, bounced and hardfail status so we can only take actions in case of a bounced email only.

func BatchUpdateSGStatus

func BatchUpdateSGStatus(req *request.Request, res *response.Response, next func())

Updates Sendgrid status Sendgrid is by far the best way to handle emails The status varies with granular details which helps in taking decisions properly. Sendgrid posts an array of JSON events.

func GetStats

func GetStats(req *request.Request, res *response.Response, next func())

Returns stats of last week

func IsLoggedIn

func IsLoggedIn(res *response.Response) bool

func LoginIndex

func LoginIndex(req *request.Request, res *response.Response, next func())

func LoginVerify

func LoginVerify(req *request.Request, res *response.Response, next func())

func UserIndex

func UserIndex(req *request.Request, res *response.Response, next func())

func UserLogout

func UserLogout(req *request.Request, res *response.Response, next func())

Logout handler

func UserUpdate

func UserUpdate(req *request.Request, res *response.Response, next func())

Types

This section is empty.

Jump to

Keyboard shortcuts

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