chunk the yaml into sections

This commit is contained in:
Brad Rydzewski
2016-04-19 18:37:53 -07:00
parent fd63d6e03d
commit b5823d20ff
19 changed files with 966 additions and 177 deletions

View File

@@ -2,6 +2,7 @@ package router
import (
"net/http"
"os"
"strings"
"github.com/gin-gonic/gin"
@@ -136,8 +137,14 @@ func Load(middleware ...gin.HandlerFunc) http.Handler {
stream.Use(session.SetRepo())
stream.Use(session.SetPerm())
stream.Use(session.MustPull)
stream.GET("/:owner/:name", web.GetRepoEvents)
stream.GET("/:owner/:name/:build/:number", web.GetStream)
if os.Getenv("CANARY") == "true" {
stream.GET("/:owner/:name", web.GetRepoEvents2)
stream.GET("/:owner/:name/:build/:number", web.GetStream2)
} else {
stream.GET("/:owner/:name", web.GetRepoEvents)
stream.GET("/:owner/:name/:build/:number", web.GetStream)
}
}
bots := e.Group("/bots")
@@ -154,6 +161,14 @@ func Load(middleware ...gin.HandlerFunc) http.Handler {
auth.POST("/token", web.GetLoginToken)
}
queue := e.Group("/api/queue")
{
queue.POST("/pull", api.Pull)
queue.POST("/wait/:id", api.Wait)
queue.POST("/stream/:id", api.Stream)
queue.POST("/status/:id", api.Update)
}
gitlab := e.Group("/gitlab/:owner/:name")
{
gitlab.Use(session.SetRepo())