コード例 #1
0
ファイル: route_priv.go プロジェクト: soygul/titan
// 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))
}
コード例 #2
0
ファイル: route_pub.go プロジェクト: soygul/titan
// 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))
}