Add support for Function and Trigger domain objects (#1060)

Vast commit, includes:

 * Introduces the Trigger domain entity.
 * Introduces the Fns domain entity.
 * V2 of the API for interacting with the new entities in swaggerv2.yml
 * Adds v2 end points for Apps to support PUT updates.
 * Rewrites the datastore level tests into a new pattern.
 * V2 routes use entity ID over name as the path parameter.
This commit is contained in:
Tom Coupland
2018-06-25 15:37:06 +01:00
committed by GitHub
parent a5abecaafb
commit 3ebff051a4
76 changed files with 5820 additions and 892 deletions

View File

@@ -32,11 +32,11 @@ func (c *middlewareController) CallFunction(w http.ResponseWriter, r *http.Reque
// since we added middleware that checks the app ID
// we need to ensure that we set it as soon as possible
appName := ctx.Value(api.CApp).(string)
appName := ctx.Value(api.AppName).(string)
if appName != "" {
appID, err := c.server.datastore.GetAppID(ctx, appName)
if err != nil {
handleErrorResponse(c.ginContext, err)
handleV1ErrorResponse(c.ginContext, err)
c.ginContext.Abort()
return
}
@@ -78,7 +78,7 @@ func (s *Server) runMiddleware(c *gin.Context, ms []fnext.Middleware) {
err := recover()
if err != nil {
common.Logger(c.Request.Context()).WithField("MiddleWarePanicRecovery:", err).Errorln("A panic occurred during middleware.")
handleErrorResponse(c, ErrInternalServerError)
handleV1ErrorResponse(c, ErrInternalServerError)
}
}()