Ejemplo n.º 1
0
// We need *data.Queue (pointer to interface) so that the closure below won't capture the actual value that pointer points to
// so we can swap queues whenever we want using Server.SetQueue(...)
func initPrivRoutes(r *middleware.Router, q *data.Queue) {
	r.Request("auth.jwt", initJWTAuthHandler())
	r.Request("echo", middleware.Echo)
	r.Request("msg.send", initSendMsgHandler(q))
}
Ejemplo n.º 2
0
// We need *data.DB (pointer to interface) so that the closure below won't capture the actual value that pointer points to
// so we can swap databases whenever we want using Server.SetDB(...)
//
// Also we don't do `return ctx.Next()` so that request won't reach the private routes.
func initPubRoutes(r *middleware.Router, db *data.DB, pass string) {
	r.Request("auth.google", initGoogleAuthHandler(db, pass))
}