Depend on iron-io/runner instead of iron-io/worker (#124)

This commit is contained in:
Seif Lotfy سيف لطفي
2016-10-05 20:42:12 +02:00
committed by GitHub
parent eed5422c59
commit fbcec6bf40
24 changed files with 142 additions and 146 deletions

View File

@@ -7,12 +7,12 @@ import (
"github.com/gin-gonic/gin"
"github.com/iron-io/functions/api/models"
titancommon "github.com/iron-io/worker/common"
"github.com/iron-io/runner/common"
)
func handleAppCreate(c *gin.Context) {
ctx := c.MustGet("ctx").(context.Context)
log := titancommon.Logger(ctx)
log := common.Logger(ctx)
var wapp models.AppWrapper

View File

@@ -7,12 +7,12 @@ import (
"github.com/gin-gonic/gin"
"github.com/iron-io/functions/api/models"
titancommon "github.com/iron-io/worker/common"
"github.com/iron-io/runner/common"
)
func handleAppDelete(c *gin.Context) {
ctx := c.MustGet("ctx").(context.Context)
log := titancommon.Logger(ctx)
log := common.Logger(ctx)
appName := c.Param("app")
err := Api.Datastore.RemoveApp(appName)

View File

@@ -7,12 +7,12 @@ import (
"github.com/gin-gonic/gin"
"github.com/iron-io/functions/api/models"
titancommon "github.com/iron-io/worker/common"
"github.com/iron-io/runner/common"
)
func handleAppGet(c *gin.Context) {
ctx := c.MustGet("ctx").(context.Context)
log := titancommon.Logger(ctx)
log := common.Logger(ctx)
appName := c.Param("app")
app, err := Api.Datastore.GetApp(appName)

View File

@@ -7,12 +7,12 @@ import (
"github.com/gin-gonic/gin"
"github.com/iron-io/functions/api/models"
titancommon "github.com/iron-io/worker/common"
"github.com/iron-io/runner/common"
)
func handleAppList(c *gin.Context) {
ctx := c.MustGet("ctx").(context.Context)
log := titancommon.Logger(ctx)
log := common.Logger(ctx)
filter := &models.AppFilter{}

View File

@@ -7,12 +7,12 @@ import (
"github.com/gin-gonic/gin"
"github.com/iron-io/functions/api/models"
titancommon "github.com/iron-io/worker/common"
"github.com/iron-io/runner/common"
)
func handleAppUpdate(c *gin.Context) {
ctx := c.MustGet("ctx").(context.Context)
log := titancommon.Logger(ctx)
log := common.Logger(ctx)
wapp := models.AppWrapper{}

View File

@@ -13,7 +13,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/iron-io/functions/api/models"
"github.com/iron-io/functions/api/runner"
titancommon "github.com/iron-io/worker/common"
"github.com/iron-io/runner/common"
)
type appResponse struct {
@@ -45,7 +45,7 @@ func testRouter() *gin.Engine {
r := gin.Default()
ctx := context.Background()
r.Use(func(c *gin.Context) {
ctx, _ := titancommon.LoggerWithFields(ctx, extractFields(c))
ctx, _ := common.LoggerWithFields(ctx, extractFields(c))
c.Set("ctx", ctx)
c.Next()
})

View File

@@ -8,12 +8,12 @@ import (
"github.com/gin-gonic/gin"
"github.com/iron-io/functions/api/models"
"github.com/iron-io/functions/api/runner"
titancommon "github.com/iron-io/worker/common"
"github.com/iron-io/runner/common"
)
func handleRouteCreate(c *gin.Context) {
ctx := c.MustGet("ctx").(context.Context)
log := titancommon.Logger(ctx)
log := common.Logger(ctx)
var wroute models.RouteWrapper

View File

@@ -7,12 +7,12 @@ import (
"github.com/gin-gonic/gin"
"github.com/iron-io/functions/api/models"
titancommon "github.com/iron-io/worker/common"
"github.com/iron-io/runner/common"
)
func handleRouteDelete(c *gin.Context) {
ctx := c.MustGet("ctx").(context.Context)
log := titancommon.Logger(ctx)
log := common.Logger(ctx)
appName := c.Param("app")
routePath := c.Param("route")

View File

@@ -8,12 +8,12 @@ import (
"github.com/Sirupsen/logrus"
"github.com/gin-gonic/gin"
"github.com/iron-io/functions/api/models"
titancommon "github.com/iron-io/worker/common"
"github.com/iron-io/runner/common"
)
func handleRouteGet(c *gin.Context) {
ctx := c.MustGet("ctx").(context.Context)
log := titancommon.Logger(ctx)
log := common.Logger(ctx)
appName := c.Param("app")
routePath := c.Param("route")

View File

@@ -8,12 +8,12 @@ import (
"github.com/Sirupsen/logrus"
"github.com/gin-gonic/gin"
"github.com/iron-io/functions/api/models"
titancommon "github.com/iron-io/worker/common"
"github.com/iron-io/runner/common"
)
func handleRouteList(c *gin.Context) {
ctx := c.MustGet("ctx").(context.Context)
log := titancommon.Logger(ctx)
log := common.Logger(ctx)
filter := &models.RouteFilter{}

View File

@@ -7,12 +7,12 @@ import (
"github.com/gin-gonic/gin"
"github.com/iron-io/functions/api/models"
titancommon "github.com/iron-io/worker/common"
"github.com/iron-io/runner/common"
)
func handleRouteUpdate(c *gin.Context) {
ctx := c.MustGet("ctx").(context.Context)
log := titancommon.Logger(ctx)
log := common.Logger(ctx)
var wroute models.RouteWrapper

View File

@@ -14,10 +14,10 @@ import (
"github.com/Sirupsen/logrus"
"github.com/gin-gonic/gin"
"github.com/iron-io/functions/api/common"
"github.com/iron-io/functions/api/models"
"github.com/iron-io/functions/api/runner"
"github.com/iron-io/worker/runner/drivers"
"github.com/iron-io/runner/common"
"github.com/iron-io/runner/drivers"
"github.com/satori/go.uuid"
)

View File

@@ -13,8 +13,7 @@ import (
"github.com/iron-io/functions/api/ifaces"
"github.com/iron-io/functions/api/models"
"github.com/iron-io/functions/api/runner"
"github.com/iron-io/worker/common"
titancommon "github.com/iron-io/worker/common"
"github.com/iron-io/runner/common"
)
// Would be nice to not have this is a global, but hard to pass things around to the
@@ -139,7 +138,7 @@ func extractFields(c *gin.Context) logrus.Fields {
func (s *Server) Run(ctx context.Context) {
s.Router.Use(func(c *gin.Context) {
ctx, _ := titancommon.LoggerWithFields(ctx, extractFields(c))
ctx, _ := common.LoggerWithFields(ctx, extractFields(c))
c.Set("ctx", ctx)
c.Next()
})