From 72a414152a8d446a38efd4b82a1a03844dc14203 Mon Sep 17 00:00:00 2001 From: skothari-tibco Date: Thu, 21 Mar 2019 06:23:08 -0400 Subject: [PATCH 01/10] Revert "FIx return" This reverts commit a31f5cdf57061f74d553647ea1fdce6c2a278423. --- activity/actreply/activity_test.go | 5 ++-- activity/actreply/descriptor.json | 4 --- activity/actreturn/activity_test.go | 4 +-- activity/actreturn/descriptor.json | 4 --- activity/mapper/activity_test.go | 12 ++++----- activity/rest/activity_test.go | 28 ++++++++++---------- go.mod | 8 +++--- go.sum | 6 ----- trigger/cli/trigger_test.go | 2 +- trigger/rest/metadata.go | 1 - trigger/rest/trigger.go | 40 +++++++---------------------- 11 files changed, 39 insertions(+), 75 deletions(-) diff --git a/activity/actreply/activity_test.go b/activity/actreply/activity_test.go index 97729d77..b6f92bd2 100755 --- a/activity/actreply/activity_test.go +++ b/activity/actreply/activity_test.go @@ -43,7 +43,6 @@ func TestSimpleReply(t *testing.T) { act, err := New(iCtx) assert.Nil(t, err) - ac := newActionContext() tc := test.NewActivityContextWithAction(act.Metadata(), ac) @@ -51,7 +50,7 @@ func TestSimpleReply(t *testing.T) { done, err := act.Eval(tc) assert.Nil(t, err) assert.True(t, done) - + assert.Nil(t, ac.ReplyErr) o1, exists1 := ac.ReplyData["Output1"] assert.True(t, exists1, "Output1 not set") @@ -67,7 +66,7 @@ func TestSimpleReply(t *testing.T) { func newActionContext() *test.TestActivityHost { input := map[string]data.TypedValue{"Input1": data.NewTypedValue(data.TypeString, "")} - output := map[string]data.TypedValue{"Output1": data.NewTypedValue(data.TypeString, "1"), "Output2": data.NewTypedValue(data.TypeInt, "2")} + output := map[string]data.TypedValue{"Output1": data.NewTypedValue(data.TypeString, ""), "Output2": data.NewTypedValue(data.TypeInt, "")} ac := &test.TestActivityHost{ HostId: "1", diff --git a/activity/actreply/descriptor.json b/activity/actreply/descriptor.json index a71c8132..bbd0a15b 100755 --- a/activity/actreply/descriptor.json +++ b/activity/actreply/descriptor.json @@ -5,11 +5,7 @@ "title": "Reply To Trigger", "description": "Replies to Trigger", "homepage": "https://github.com/project-flogo/contrib/tree/master/activity/actreply", -<<<<<<< Updated upstream "reply":true, -======= - "return":true, ->>>>>>> Stashed changes "settings":[ { "name": "mappings", diff --git a/activity/actreturn/activity_test.go b/activity/actreturn/activity_test.go index 3c2e2782..a5273948 100755 --- a/activity/actreturn/activity_test.go +++ b/activity/actreturn/activity_test.go @@ -66,11 +66,11 @@ func TestSimpleReturn(t *testing.T) { func newActionContext() *test.TestActivityHost { input := map[string]data.TypedValue{"Input1": data.NewTypedValue(data.TypeString, "")} - output := map[string]data.TypedValue{"Output1": data.NewTypedValue(data.TypeString, "1"), "Output2": data.NewTypedValue(data.TypeInt, "2")} + output := map[string]data.TypedValue{"Output1": data.NewTypedValue(data.TypeString, ""), "Output2": data.NewTypedValue(data.TypeInt, "")} ac := &test.TestActivityHost{ HostId: "1", - HostRef: "github.com/project-flogo/flow", + HostRef: "github.com/TIBCOSoftware/flogo-contrib/action/flow", IoMetadata: &metadata.IOMetadata{Input: input, Output: output}, HostData: data.NewSimpleScope(nil, nil), } diff --git a/activity/actreturn/descriptor.json b/activity/actreturn/descriptor.json index 1c9f96de..32c28c4e 100755 --- a/activity/actreturn/descriptor.json +++ b/activity/actreturn/descriptor.json @@ -6,11 +6,7 @@ "description": "Return Activity", "homepage": "https://github.com/prject-flogo/contrib/tree/master/activity/actreturn", "return":true, -<<<<<<< Updated upstream "settings":[ -======= - "setting":[ ->>>>>>> Stashed changes { "name": "mappings", "type": "object", diff --git a/activity/mapper/activity_test.go b/activity/mapper/activity_test.go index a9a492e6..e07d70c9 100755 --- a/activity/mapper/activity_test.go +++ b/activity/mapper/activity_test.go @@ -3,9 +3,8 @@ package activity_mapper import ( "encoding/json" "testing" - "github.com/project-flogo/core/data/mapper" + "github.com/project-flogo/core/activity" - "github.com/project-flogo/core/data/resolve" "github.com/project-flogo/core/data" "github.com/project-flogo/core/data/metadata" "github.com/project-flogo/core/support/test" @@ -36,9 +35,8 @@ func TestSimpleMapper(t *testing.T) { } settings := map[string]interface{}{"mappings": mappings} - mf := mapper.NewFactory(resolve.GetBasicResolver()) - iCtx := test.NewActivityInitContext(settings, mf) - act, err := New(iCtx) + + act, err := New(settings) assert.Nil(t, err) ah := newActivityHost() @@ -56,7 +54,7 @@ func TestSimpleMapper(t *testing.T) { o2, exists2 := ah.HostData.GetValue("Output2") assert.True(t, exists2, "Output2 not set") if exists2 { - assert.Equal(t, 2.0, o2) + assert.Equal(t, 2, o2) } } @@ -66,7 +64,7 @@ func newActivityHost() *test.TestActivityHost { ac := &test.TestActivityHost{ HostId: "1", - HostRef: "github.com/project-flogo/flow", + HostRef: "github.com/TIBCOSoftware/flogo-contrib/action/flow", IoMetadata: &metadata.IOMetadata{Input: input, Output: output}, HostData: data.NewSimpleScope(nil, nil), } diff --git a/activity/rest/activity_test.go b/activity/rest/activity_test.go index 402315b3..3d0e1d0c 100644 --- a/activity/rest/activity_test.go +++ b/activity/rest/activity_test.go @@ -1,9 +1,10 @@ package rest import ( + "encoding/json" "fmt" "testing" - "net/http" + "github.com/project-flogo/core/activity" "github.com/project-flogo/core/data/mapper" "github.com/project-flogo/core/data/resolve" @@ -64,11 +65,14 @@ func TestSimplePost(t *testing.T) { //eval act.Eval(tc) - output := &Output{} - tc.GetOutputObject(output) + val := tc.GetOutput("result") + + fmt.Printf("result: %v\n", val) - assert.Equal(t, http.StatusOK, output.Status) + res := val.(map[string]interface{}) + petID = res["id"].(json.Number).String() + fmt.Println("petID:", petID) } func TestSimpleGet(t *testing.T) { @@ -84,9 +88,9 @@ func TestSimpleGet(t *testing.T) { //eval act.Eval(tc) - output := &Output{} - tc.GetOutputObject(output) - assert.Equal(t, http.StatusNotFound, output.Status) + + val := tc.GetOutput("result") + fmt.Printf("result: %v\n", val) } func TestSimpleGetWithHeaders(t *testing.T) { @@ -107,9 +111,8 @@ func TestSimpleGetWithHeaders(t *testing.T) { //eval act.Eval(tc) - output := &Output{} - tc.GetOutputObject(output) - assert.Equal(t, http.StatusOK, output.Status) + val := tc.GetOutput("result") + fmt.Printf("result: %v\n", val) } func TestParamGet(t *testing.T) { @@ -131,9 +134,8 @@ func TestParamGet(t *testing.T) { //eval act.Eval(tc) - output := &Output{} - tc.GetOutputObject(output) - //assert.Equal(t, 200, output.Status) + val := tc.GetOutput("result") + fmt.Printf("result: %v\n", val) } //func TestSimpleGetWithProxy(t *testing.T) { diff --git a/go.mod b/go.mod index cb17058b..23bc3871 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,9 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/julienschmidt/httprouter v1.2.0 github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 - github.com/project-flogo/core v0.9.0-alpha.4.0.20190213174534-066cf88d3782 - github.com/stretchr/objx v0.1.1 // indirect - github.com/stretchr/testify v1.3.0 + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/project-flogo/core v0.9.0-alpha.4 + github.com/stretchr/testify v1.2.2 + go.uber.org/atomic v1.3.2 // indirect + go.uber.org/multierr v1.1.0 // indirect ) diff --git a/go.sum b/go.sum index 487110b8..1a48ad06 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,5 @@ github.com/carlescere/scheduler v0.0.0-20170109141437-ee74d2f83d82 h1:9bAydALqAjBfPHd/eAiJBHnMZUYov8m2PkXVr+YGQeI= github.com/carlescere/scheduler v0.0.0-20170109141437-ee74d2f83d82/go.mod h1:tyA14J0sA3Hph4dt+AfCjPrYR13+vVodshQSM7km9qw= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g= @@ -15,15 +14,10 @@ github.com/project-flogo/core v0.9.0-alpha.3 h1:G7ToVpdoRthE9BhefJWVL1yy+FxhLbA7 github.com/project-flogo/core v0.9.0-alpha.3/go.mod h1:BHeB55AxPhvlNGd+it50rE977ag6xE3bD2RluSDeKBA= github.com/project-flogo/core v0.9.0-alpha.4 h1:ny3yB8vMBRXxIXuk3V2DYxVDUN6HlqUQA70yWVWHCS0= github.com/project-flogo/core v0.9.0-alpha.4/go.mod h1:BHeB55AxPhvlNGd+it50rE977ag6xE3bD2RluSDeKBA= -github.com/project-flogo/core v0.9.0-alpha.4.0.20190213174534-066cf88d3782 h1:4ODKDIruYifAibvaxOxgDKyP1alTSo0HOuyUiG/mAJM= -github.com/project-flogo/core v0.9.0-alpha.4.0.20190213174534-066cf88d3782/go.mod h1:Dof6t60n/nvN7aPpoUz97JL+VIKdsYMbhqwN++WCdz8= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= diff --git a/trigger/cli/trigger_test.go b/trigger/cli/trigger_test.go index 7b9a738c..1b4ec504 100644 --- a/trigger/cli/trigger_test.go +++ b/trigger/cli/trigger_test.go @@ -7,7 +7,7 @@ import ( var jsonTestMetadata = getTestJsonMetadata() func getTestJsonMetadata() string { - jsonMetadataBytes, err := ioutil.ReadFile("./examples/single/flogo-single-cli.json") + jsonMetadataBytes, err := ioutil.ReadFile("trigger.json") if err != nil { panic("No Json Metadata found for trigger.json path") } diff --git a/trigger/rest/metadata.go b/trigger/rest/metadata.go index 536565c4..42c733a9 100644 --- a/trigger/rest/metadata.go +++ b/trigger/rest/metadata.go @@ -11,7 +11,6 @@ type Settings struct { type HandlerSettings struct { Method string `md:"method,required,allowed(GET,POST,PUT,PATCH,DELETE)"` Path string `md:"path,required"` - File string `md:"file"` } type Output struct { diff --git a/trigger/rest/trigger.go b/trigger/rest/trigger.go index 3a0808c5..c8c2c5db 100644 --- a/trigger/rest/trigger.go +++ b/trigger/rest/trigger.go @@ -8,7 +8,6 @@ import ( "io/ioutil" "net/http" "net/url" - "os" "strconv" "strings" @@ -24,7 +23,6 @@ const ( ) var triggerMd = trigger.NewMetadata(&Settings{}, &HandlerSettings{}, &Output{}, &Reply{}) -var hanlderSettings *HandlerSettings func init() { trigger.Register(&Trigger{}, &Factory{}) @@ -71,14 +69,15 @@ func (t *Trigger) Initialize(ctx trigger.InitContext) error { // Init handlers for _, handler := range ctx.GetHandlers() { - hanlderSettings = &HandlerSettings{} - err := metadata.MapToStruct(handler.Settings(), hanlderSettings, true) + + s := &HandlerSettings{} + err := metadata.MapToStruct(handler.Settings(), s, true) if err != nil { return err } - method := hanlderSettings.Method - path := hanlderSettings.Path + method := s.Method + path := s.Path t.logger.Debugf("Registering handler [%s: %s]", method, path) @@ -188,33 +187,12 @@ func newActionHandler(rt *Trigger, handler trigger.Handler) httprouter.Handle { } out.Content = content default: - - if strings.Contains(contentType, "multipart/form-data") && hanlderSettings.File != "" { - - r.ParseMultipartForm(5 * 1024 * 1024) - file, header, err := r.FormFile(hanlderSettings.File) - - //Save the file - f, err := os.OpenFile(header.Filename, os.O_WRONLY|os.O_CREATE, 0666) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - defer f.Close() - io.Copy(f, file) - - //Pass the fileName so that we can read the file later on - out.Content = header.Filename - - } else { - b, err := ioutil.ReadAll(r.Body) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - } - - out.Content = string(b) + b, err := ioutil.ReadAll(r.Body) + if err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) } + out.Content = string(b) } results, err := handler.Handle(context.Background(), out) From a2693a9cc6dc632992bcb21648b4c73d34ed8ac6 Mon Sep 17 00:00:00 2001 From: skothari-tibco Date: Mon, 1 Apr 2019 13:16:48 -0400 Subject: [PATCH 02/10] fix test --- activity/channel/go.mod | 2 + trigger/channel/trigger_test.go | 5 ++- trigger/cli/go.mod | 9 +++- trigger/cli/go.sum | 6 +++ trigger/cli/trigger.go | 3 +- trigger/cli/trigger_test.go | 76 ++++++++++++++++++++++++--------- trigger/rest/trigger_test.go | 23 +++++----- trigger/timer/go.mod | 3 ++ trigger/timer/timer_test.go | 13 +++++- 9 files changed, 103 insertions(+), 37 deletions(-) diff --git a/activity/channel/go.mod b/activity/channel/go.mod index f45d30bc..f08a56f7 100644 --- a/activity/channel/go.mod +++ b/activity/channel/go.mod @@ -3,4 +3,6 @@ module github.com/project-flogo/contrib/activity/channel require ( github.com/project-flogo/core v0.9.0-beta.1 github.com/stretchr/testify v1.3.0 + go.uber.org/atomic v1.3.2 // indirect + go.uber.org/multierr v1.1.0 // indirect ) diff --git a/trigger/channel/trigger_test.go b/trigger/channel/trigger_test.go index fb5be9f0..e008ac96 100644 --- a/trigger/channel/trigger_test.go +++ b/trigger/channel/trigger_test.go @@ -69,8 +69,9 @@ func TestChannelTrigger_Initialize(t *testing.T) { })} trg, err := test.InitTrigger(f, config, actions) - assert.NotNil(t, err) - assert.Nil(t, trg) + assert.Nil(t, err) + assert.NotNil(t, trg) + } /* diff --git a/trigger/cli/go.mod b/trigger/cli/go.mod index d9db773f..117ed1f0 100644 --- a/trigger/cli/go.mod +++ b/trigger/cli/go.mod @@ -1,3 +1,10 @@ module github.com/project-flogo/contrib/trigger/cli -require github.com/project-flogo/core v0.9.0-alpha.6 +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/project-flogo/core v0.9.0-beta.1 + github.com/stretchr/objx v0.1.1 // indirect + github.com/stretchr/testify v1.3.0 +) + +replace github.com/project-flogo/core v0.9.0-beta.1 => /Users/skothari-tibco/Documents/core diff --git a/trigger/cli/go.sum b/trigger/cli/go.sum index 1f44d916..9f9cfb90 100644 --- a/trigger/cli/go.sum +++ b/trigger/cli/go.sum @@ -1,3 +1,4 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= @@ -6,11 +7,16 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/project-flogo/core v0.9.0-alpha.6 h1:ugQmmE1WQ75gzHwFpIv7Wbt1wTqNmWj94J8t6sKdKPw= github.com/project-flogo/core v0.9.0-alpha.6/go.mod h1:eB+hMcq51lOIeJ93K8Nvvm/vC3OI60ZaEgBbA4gtk8k= +github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= +github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= github.com/square-it/jsonschema v1.9.1/go.mod h1:80WJHSuy3YnokzfFopfx+MAt5lVVnVpS6w2Avv+svHk= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= diff --git a/trigger/cli/trigger.go b/trigger/cli/trigger.go index 849214f6..eb5acd1d 100644 --- a/trigger/cli/trigger.go +++ b/trigger/cli/trigger.go @@ -155,7 +155,8 @@ func Invoke() (string, error) { cliPath, _ := os.Executable() cliName := filepath.Base(cliPath) - + + //Todo? if singleton.settings.SingleCmd { } diff --git a/trigger/cli/trigger_test.go b/trigger/cli/trigger_test.go index 789205ba..94209112 100644 --- a/trigger/cli/trigger_test.go +++ b/trigger/cli/trigger_test.go @@ -1,40 +1,74 @@ package cli import ( - "io/ioutil" -) + "encoding/json" + "testing" -var jsonTestMetadata = getTestJsonMetadata() + "github.com/project-flogo/core/action" + "github.com/project-flogo/core/support/test" + "github.com/project-flogo/core/trigger" + "github.com/stretchr/testify/assert" +) -func getTestJsonMetadata() string { - jsonMetadataBytes, err := ioutil.ReadFile("trigger.json") - if err != nil { - panic("No Json Metadata found for trigger.json path") - } - return string(jsonMetadataBytes) -} +//var jsonTestMetadata = getTestJsonMetadata() +// +//func getTestJsonMetadata() string { +// jsonMetadataBytes, err := ioutil.ReadFile("trigger.json") +// if err != nil { +// panic("No Json Metadata found for trigger.json path") +// } +// return string(jsonMetadataBytes) +//} const testConfig string = `{ "id": "flogo-cli", - "ref": "github.com/project-flogo/contrib/trigger/cli", + "ref": "github.com/project-flogo/contrib/trigger/cli", + "settings":{ + "singleCmd":true + }, "handlers": [ { - "actionId": "", - "settings": { - "command": "run", - "default": "true" - } - }, - { - "actionId": "version_flow", - "settings": { - "command": "version" + "action":{ + "id": "dummy" + }, + "settings": { + "command": "run" } } ] } ` +func TestInitOk(t *testing.T) { + // New factory + f := &Factory{} + + config := &trigger.Config{} + json.Unmarshal([]byte(testConfig), &config) + tgr, err := f.New(config) + assert.Nil(t, err) + assert.NotNil(t, tgr) + +} + +func TestCliTrigger_Initialize(t *testing.T) { + f := &Factory{} + + config := &trigger.Config{} + err := json.Unmarshal([]byte(testConfig), config) + assert.Nil(t, err) + + actions := map[string]action.Action{"dummy": test.NewDummyAction(func() { + //do nothing + })} + + trg, err := test.InitTrigger(f, config, actions) + assert.Nil(t, err) + assert.NotNil(t, trg) + _, err = Invoke() + assert.Nil(t, err) +} + /* //TODO fix this test func TestInitOk(t *testing.T) { diff --git a/trigger/rest/trigger_test.go b/trigger/rest/trigger_test.go index f964e662..289c66ed 100644 --- a/trigger/rest/trigger_test.go +++ b/trigger/rest/trigger_test.go @@ -4,16 +4,17 @@ import ( "context" "crypto/tls" "crypto/x509" + "encoding/json" "fmt" "sync" "testing" "time" - "encoding/json" + "github.com/project-flogo/core/action" - "github.com/project-flogo/core/support/test" "github.com/project-flogo/core/api" "github.com/project-flogo/core/engine" "github.com/project-flogo/core/support" + "github.com/project-flogo/core/support/test" "github.com/project-flogo/core/trigger" "github.com/stretchr/testify/assert" ) @@ -24,6 +25,7 @@ func TestTrigger_Register(t *testing.T) { f := trigger.GetFactory(ref) assert.NotNil(t, f) } + const testConfig string = `{ "id": "trigger-rest", "ref": "github.com/project-flogo/contrib/trigger/rest", @@ -42,28 +44,27 @@ const testConfig string = `{ } ] }` + func TestRestTrigger_Initialize(t *testing.T) { - + f := &Factory{} config := &trigger.Config{} err := json.Unmarshal([]byte(testConfig), config) assert.Nil(t, err) - actions := map[string]action.Action{ - "dummy": test.NewDummyAction(func() { - - })} + actions := map[string]action.Action{"dummy": test.NewDummyAction(func() { + })} trg, err := test.InitTrigger(f, config, actions) - + assert.Nil(t, err) assert.NotNil(t, trg) err = trg.Start() - assert.Nil(t,err) + assert.Nil(t, err) err = trg.Stop() - assert.Nil(t,err) - + assert.Nil(t, err) + } func Test_App(t *testing.T) { diff --git a/trigger/timer/go.mod b/trigger/timer/go.mod index c9482f23..763ab519 100644 --- a/trigger/timer/go.mod +++ b/trigger/timer/go.mod @@ -3,4 +3,7 @@ module github.com/project-flogo/contrib/trigger/timer require ( github.com/carlescere/scheduler v0.0.0-20170109141437-ee74d2f83d82 github.com/project-flogo/core v0.9.0-beta.1 + github.com/stretchr/testify v1.3.0 + go.uber.org/atomic v1.3.2 // indirect + go.uber.org/multierr v1.1.0 // indirect ) diff --git a/trigger/timer/timer_test.go b/trigger/timer/timer_test.go index b0109090..7aa675ac 100644 --- a/trigger/timer/timer_test.go +++ b/trigger/timer/timer_test.go @@ -1,3 +1,14 @@ package timer -//todo implement +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestInitOk(t *testing.T) { + f := &Factory{} + tgr, err := f.New(nil) + assert.Nil(t, err) + assert.NotNil(t, tgr) +} From ab52f01d7ae5e478461fa4eeac289e5b6aec3c0d Mon Sep 17 00:00:00 2001 From: Frank Martinez Date: Mon, 1 Apr 2019 22:13:50 -0400 Subject: [PATCH 03/10] add returnType to function descriptions --- function/coerce/descriptor.json | 36 ++++++++++++++++++++++----------- function/coerce/go.sum | 14 ++++++------- function/json/descriptor.json | 3 ++- function/json/go.mod | 1 + function/json/go.sum | 14 ++++++------- function/json/path.go | 2 +- function/number/go.sum | 14 ++++++------- function/string/descriptor.json | 24 ++++++++++++++-------- function/string/go.sum | 6 ++++-- 9 files changed, 69 insertions(+), 45 deletions(-) diff --git a/function/coerce/descriptor.json b/function/coerce/descriptor.json index a1cd3928..e16d4b75 100644 --- a/function/coerce/descriptor.json +++ b/function/coerce/descriptor.json @@ -18,7 +18,8 @@ "name": "type", "type": "string" } - ] + ], + "returnType": "any" }, { "name": "toString", @@ -28,7 +29,8 @@ "name": "value", "type": "any" } - ] + ], + "returnType": "string" }, { "name": "toInt", @@ -38,7 +40,8 @@ "name": "value", "type": "any" } - ] + ], + "returnType": "int" }, { "name": "toInt32", @@ -48,7 +51,8 @@ "name": "value", "type": "any" } - ] + ], + "returnType": "int32" }, { "name": "toInt64", @@ -58,7 +62,8 @@ "name": "value", "type": "any" } - ] + ], + "returnType": "int64" }, { "name": "toFloat32", @@ -68,7 +73,8 @@ "name": "value", "type": "any" } - ] + ], + "returnType": "float32" }, { "name": "toFloat64", @@ -78,7 +84,8 @@ "name": "value", "type": "any" } - ] + ], + "returnType": "float64" }, { "name": "toBool", @@ -88,7 +95,8 @@ "name": "value", "type": "any" } - ] + ], + "returnType": "bool" }, { "name": "toBytes", @@ -98,7 +106,8 @@ "name": "value", "type": "any" } - ] + ], + "returnType": "bytes" }, { "name": "toParams", @@ -108,7 +117,8 @@ "name": "value", "type": "any" } - ] + ], + "returnType": "params" }, { "name": "toObject", @@ -118,7 +128,8 @@ "name": "value", "type": "any" } - ] + ], + "returnType": "object" }, { "name": "toArray", @@ -128,7 +139,8 @@ "name": "value", "type": "any" } - ] + ], + "returnType": "array" } ] } diff --git a/function/coerce/go.sum b/function/coerce/go.sum index b661751c..a2925fa0 100644 --- a/function/coerce/go.sum +++ b/function/coerce/go.sum @@ -1,14 +1,14 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/project-flogo/core v0.9.0-beta.1 h1:ToDfk5H61p8j6uhPZzIeHQ8TBCj8M4DzUcna4+2KbO8= +github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:eB+hMcq51lOIeJ93K8Nvvm/vC3OI60ZaEgBbA4gtk8k= +github.com/square-it/jsonschema v1.9.1/go.mod h1:80WJHSuy3YnokzfFopfx+MAt5lVVnVpS6w2Avv+svHk= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= diff --git a/function/json/descriptor.json b/function/json/descriptor.json index 8ea07b7a..e3100f7e 100644 --- a/function/json/descriptor.json +++ b/function/json/descriptor.json @@ -18,7 +18,8 @@ "name": "object", "type": "any" } - ] + ], + "returnType": "any" } ] } diff --git a/function/json/go.mod b/function/json/go.mod index a5205d7c..67eeda25 100644 --- a/function/json/go.mod +++ b/function/json/go.mod @@ -3,4 +3,5 @@ module github.com/project-flogo/contrib/function/json require ( github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 github.com/project-flogo/core v0.9.0-beta.1 + github.com/stretchr/testify v1.2.2 ) diff --git a/function/json/go.sum b/function/json/go.sum index 390d3c29..8df41e83 100644 --- a/function/json/go.sum +++ b/function/json/go.sum @@ -1,16 +1,16 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjGmesFh1D0rDy+q1Twx6FyU7VWHi8wZbI= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/project-flogo/core v0.9.0-beta.1 h1:ToDfk5H61p8j6uhPZzIeHQ8TBCj8M4DzUcna4+2KbO8= +github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:eB+hMcq51lOIeJ93K8Nvvm/vC3OI60ZaEgBbA4gtk8k= +github.com/square-it/jsonschema v1.9.1/go.mod h1:80WJHSuy3YnokzfFopfx+MAt5lVVnVpS6w2Avv+svHk= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= diff --git a/function/json/path.go b/function/json/path.go index dc057423..61b7c0e6 100644 --- a/function/json/path.go +++ b/function/json/path.go @@ -7,7 +7,7 @@ import ( ) func init() { - function.Register(&fnPath{}) + _ = function.Register(&fnPath{}) } type fnPath struct { diff --git a/function/number/go.sum b/function/number/go.sum index b661751c..a2925fa0 100644 --- a/function/number/go.sum +++ b/function/number/go.sum @@ -1,14 +1,14 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/project-flogo/core v0.9.0-beta.1 h1:ToDfk5H61p8j6uhPZzIeHQ8TBCj8M4DzUcna4+2KbO8= +github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:eB+hMcq51lOIeJ93K8Nvvm/vC3OI60ZaEgBbA4gtk8k= +github.com/square-it/jsonschema v1.9.1/go.mod h1:80WJHSuy3YnokzfFopfx+MAt5lVVnVpS6w2Avv+svHk= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= diff --git a/function/string/descriptor.json b/function/string/descriptor.json index 54b66cdf..220aab02 100644 --- a/function/string/descriptor.json +++ b/function/string/descriptor.json @@ -15,7 +15,8 @@ "name": "str", "type": "string" } - ] + ], + "returnType": "string" }, { "name": "equals", @@ -29,7 +30,8 @@ "name": "str2", "type": "string" } - ] + ], + "returnType": "bool" }, { "name": "equalsIgnoreCase", @@ -43,7 +45,8 @@ "name": "str2", "type": "string" } - ] + ], + "returnType": "bool" }, { "name": "contains", @@ -57,7 +60,8 @@ "name": "str2", "type": "string" } - ] + ], + "returnType": "bool" }, { "name": "float", @@ -67,7 +71,8 @@ "name": "str1", "type": "string" } - ] + ], + "returnType": "float64" }, { "name": "integer", @@ -77,7 +82,8 @@ "name": "str1", "type": "string" } - ] + ], + "returnType": "int" }, { "name": "len", @@ -87,7 +93,8 @@ "name": "str1", "type": "string" } - ] + ], + "returnType": "int" }, { "name": "substring", @@ -105,7 +112,8 @@ "name": "end", "type": "string" } - ] + ], + "returnType": "string" } ] } diff --git a/function/string/go.sum b/function/string/go.sum index b661751c..99d6d9f5 100644 --- a/function/string/go.sum +++ b/function/string/go.sum @@ -4,9 +4,11 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/project-flogo/core v0.9.0-beta.1 h1:ToDfk5H61p8j6uhPZzIeHQ8TBCj8M4DzUcna4+2KbO8= +github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:eB+hMcq51lOIeJ93K8Nvvm/vC3OI60ZaEgBbA4gtk8k= +github.com/square-it/jsonschema v1.9.1/go.mod h1:80WJHSuy3YnokzfFopfx+MAt5lVVnVpS6w2Avv+svHk= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= From de03dd8fa6cabc8d7270353ea4275bd739762b69 Mon Sep 17 00:00:00 2001 From: Frank Martinez Date: Mon, 1 Apr 2019 22:21:04 -0400 Subject: [PATCH 04/10] fix go mods --- function/go.mod | 10 ++++------ function/go.sum | 28 +++++++++++++++------------- function/json/go.mod | 2 +- function/json/go.sum | 8 +++++--- 4 files changed, 25 insertions(+), 23 deletions(-) diff --git a/function/go.mod b/function/go.mod index 2a177fe8..e4591eab 100644 --- a/function/go.mod +++ b/function/go.mod @@ -1,10 +1,8 @@ module github.com/project-flogo/contrib/function -go 1.12 - require ( - github.com/project-flogo/contrib/function/coerce v0.0.0-20190322010605-4c45109b59c7 - github.com/project-flogo/contrib/function/json v0.0.0-20190322010605-4c45109b59c7 - github.com/project-flogo/contrib/function/number v0.0.0-20190322010605-4c45109b59c7 - github.com/project-flogo/contrib/function/string v0.0.0-20190322010605-4c45109b59c7 + github.com/project-flogo/contrib/function/coerce v0.0.0-20190322223003-62046b3698ab + github.com/project-flogo/contrib/function/json v0.0.0-20190322223003-62046b3698ab + github.com/project-flogo/contrib/function/number v0.0.0-20190322223003-62046b3698ab + github.com/project-flogo/contrib/function/string v0.0.0-20190322223003-62046b3698ab ) diff --git a/function/go.sum b/function/go.sum index e86b6031..36c69687 100644 --- a/function/go.sum +++ b/function/go.sum @@ -1,24 +1,26 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjGmesFh1D0rDy+q1Twx6FyU7VWHi8wZbI= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/contrib/function/coerce v0.0.0-20190322010605-4c45109b59c7 h1:RmpxhZsijfUmmM5ehmGtPBNEkq1e7m8vpoVqPs7tM0A= -github.com/project-flogo/contrib/function/coerce v0.0.0-20190322010605-4c45109b59c7/go.mod h1:rU6AC3X74T0uC/53T/lSrtt/c0qqKE8kA1sBfQAk4CQ= -github.com/project-flogo/contrib/function/json v0.0.0-20190322010605-4c45109b59c7 h1:AJDuQgL8bWRpKrujZrBmwbEwpCSrkpkO/h3+YdwUoHc= -github.com/project-flogo/contrib/function/json v0.0.0-20190322010605-4c45109b59c7/go.mod h1:QhZzlNLqH/TWrMre+FLvqIykt7O79zbQ6pu9oAEdfB0= -github.com/project-flogo/contrib/function/number v0.0.0-20190322010605-4c45109b59c7 h1:D9NiYG1wBn6X5BDVshQ3t5PJlMeqgxWSu+8POj3JVjY= -github.com/project-flogo/contrib/function/number v0.0.0-20190322010605-4c45109b59c7/go.mod h1:75NDwGNYUY2GjogyBYT4Hp1CJYpjwxIgQxYxkE9/xRs= -github.com/project-flogo/contrib/function/string v0.0.0-20190322010605-4c45109b59c7 h1:UvmkKzjcg3EqYKprOXFNo3NdFtRVh1y56dAnVGhmrI8= -github.com/project-flogo/contrib/function/string v0.0.0-20190322010605-4c45109b59c7/go.mod h1:r9BdpzbQx9un7zwUwlnPGIbgC3yejuFxw74rVky/t94= -github.com/project-flogo/core v0.9.0-alpha.6 h1:ugQmmE1WQ75gzHwFpIv7Wbt1wTqNmWj94J8t6sKdKPw= -github.com/project-flogo/core v0.9.0-alpha.6/go.mod h1:eB+hMcq51lOIeJ93K8Nvvm/vC3OI60ZaEgBbA4gtk8k= +github.com/project-flogo/contrib/function/coerce v0.0.0-20190322223003-62046b3698ab h1:ONB1qG4FEXTh4y3VcCvy8vWIlgH80KTJ7nK5r0/k1WU= +github.com/project-flogo/contrib/function/coerce v0.0.0-20190322223003-62046b3698ab/go.mod h1:YUtwOZa/3s3HBpOh2vWdd4nPdRMxn4A5VpbTR2bscWM= +github.com/project-flogo/contrib/function/json v0.0.0-20190322223003-62046b3698ab h1:Pl69cgfoLF0rqPDpLg/7GRwN/iye/h2FN515kDnqKN0= +github.com/project-flogo/contrib/function/json v0.0.0-20190322223003-62046b3698ab/go.mod h1:9m2uijKX+NXnLyezc9Kkj1YFoOq/6k/NiPDkAHwIyk4= +github.com/project-flogo/contrib/function/number v0.0.0-20190322223003-62046b3698ab h1:GHDt4qe1MME14ozAmzQiCNN2Uydu5qI0odpAQr4VFwo= +github.com/project-flogo/contrib/function/number v0.0.0-20190322223003-62046b3698ab/go.mod h1:ICD9OLqygf+GAsoMtcEC9hT+GVMaCjXk0s10b2Uf2vM= +github.com/project-flogo/contrib/function/string v0.0.0-20190322223003-62046b3698ab h1:UpVEOVa0bxXYRXGQPwcIjFkBdI1+8ng5nMTaolMN4ew= +github.com/project-flogo/contrib/function/string v0.0.0-20190322223003-62046b3698ab/go.mod h1:EK7RnsG9Mbom4QExlLagiYvSAm7zgTjBUgJyCJdVamQ= +github.com/project-flogo/core v0.9.0-beta.1 h1:ToDfk5H61p8j6uhPZzIeHQ8TBCj8M4DzUcna4+2KbO8= +github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:eB+hMcq51lOIeJ93K8Nvvm/vC3OI60ZaEgBbA4gtk8k= github.com/square-it/jsonschema v1.9.1/go.mod h1:80WJHSuy3YnokzfFopfx+MAt5lVVnVpS6w2Avv+svHk= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= diff --git a/function/json/go.mod b/function/json/go.mod index 67eeda25..3794a756 100644 --- a/function/json/go.mod +++ b/function/json/go.mod @@ -3,5 +3,5 @@ module github.com/project-flogo/contrib/function/json require ( github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 github.com/project-flogo/core v0.9.0-beta.1 - github.com/stretchr/testify v1.2.2 + github.com/stretchr/testify v1.3.0 ) diff --git a/function/json/go.sum b/function/json/go.sum index 8df41e83..dca1362c 100644 --- a/function/json/go.sum +++ b/function/json/go.sum @@ -1,5 +1,5 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjGmesFh1D0rDy+q1Twx6FyU7VWHi8wZbI= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= @@ -9,8 +9,10 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/project-flogo/core v0.9.0-beta.1 h1:ToDfk5H61p8j6uhPZzIeHQ8TBCj8M4DzUcna4+2KbO8= github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:eB+hMcq51lOIeJ93K8Nvvm/vC3OI60ZaEgBbA4gtk8k= github.com/square-it/jsonschema v1.9.1/go.mod h1:80WJHSuy3YnokzfFopfx+MAt5lVVnVpS6w2Avv+svHk= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= From 0695d921a36b5d4f135b2d172018af5050be4c14 Mon Sep 17 00:00:00 2001 From: skothari-tibco Date: Tue, 2 Apr 2019 11:58:22 -0400 Subject: [PATCH 05/10] Fix test --- trigger/channel/trigger_test.go | 5 ++-- trigger/cli/trigger_test.go | 8 +++---- trigger/timer/go.mod | 4 ++-- trigger/timer/timer_test.go | 42 +++++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 9 deletions(-) diff --git a/trigger/channel/trigger_test.go b/trigger/channel/trigger_test.go index e008ac96..4497e8fa 100644 --- a/trigger/channel/trigger_test.go +++ b/trigger/channel/trigger_test.go @@ -5,8 +5,6 @@ import ( "io/ioutil" "testing" - "github.com/project-flogo/core/action" - "github.com/project-flogo/core/support/test" "github.com/project-flogo/core/trigger" "github.com/stretchr/testify/assert" ) @@ -57,6 +55,7 @@ func TestChannelFactory_New(t *testing.T) { assert.NotNil(t, trg) } +/* func TestChannelTrigger_Initialize(t *testing.T) { f := &Factory{} @@ -74,7 +73,7 @@ func TestChannelTrigger_Initialize(t *testing.T) { } -/* + func TestChannelTrigger_Initialize(t *testing.T) { f := &Factory{} diff --git a/trigger/cli/trigger_test.go b/trigger/cli/trigger_test.go index 94209112..09a4241d 100644 --- a/trigger/cli/trigger_test.go +++ b/trigger/cli/trigger_test.go @@ -28,10 +28,10 @@ const testConfig string = `{ }, "handlers": [ { - "action":{ - "id": "dummy" - }, - "settings": { + "action":{ + "id": "dummy" + }, + "settings": { "command": "run" } } diff --git a/trigger/timer/go.mod b/trigger/timer/go.mod index 763ab519..68c97881 100644 --- a/trigger/timer/go.mod +++ b/trigger/timer/go.mod @@ -4,6 +4,6 @@ require ( github.com/carlescere/scheduler v0.0.0-20170109141437-ee74d2f83d82 github.com/project-flogo/core v0.9.0-beta.1 github.com/stretchr/testify v1.3.0 - go.uber.org/atomic v1.3.2 // indirect - go.uber.org/multierr v1.1.0 // indirect ) + +replace github.com/project-flogo/core v0.9.0-beta.1 => /Users/skothari-tibco/Documents/core diff --git a/trigger/timer/timer_test.go b/trigger/timer/timer_test.go index 7aa675ac..60678c71 100644 --- a/trigger/timer/timer_test.go +++ b/trigger/timer/timer_test.go @@ -1,14 +1,56 @@ package timer import ( + "encoding/json" "testing" + "github.com/project-flogo/core/action" + "github.com/project-flogo/core/support/test" + "github.com/project-flogo/core/trigger" "github.com/stretchr/testify/assert" ) +const testConfig string = `{ + "id": "flogo-timer", + "ref": "github.com/project-flogo/contrib/trigger/timer", + "handlers": [ + { + "settings":{ + "repeatInterval" : "1s" + }, + "action":{ + "id":"dummy" + } + } + ] + } + ` + func TestInitOk(t *testing.T) { f := &Factory{} tgr, err := f.New(nil) assert.Nil(t, err) assert.NotNil(t, tgr) } + +func TestTimerTrigger_Initialize(t *testing.T) { + f := &Factory{} + + config := &trigger.Config{} + err := json.Unmarshal([]byte(testConfig), config) + assert.Nil(t, err) + + actions := map[string]action.Action{"dummy": test.NewDummyAction(func() { + //do nothing + })} + + trg, err := test.InitTrigger(f, config, actions) + assert.Nil(t, err) + assert.NotNil(t, trg) + + err = trg.Start() + assert.Nil(t, err) + err = trg.Stop() + assert.Nil(t, err) + +} From 595a7fc76cc4f3ebd2db059019933d6038b0c7d1 Mon Sep 17 00:00:00 2001 From: skothari-tibco Date: Tue, 2 Apr 2019 17:55:44 -0400 Subject: [PATCH 06/10] remove replace --- trigger/channel/go.mod | 2 -- trigger/cli/go.mod | 1 - trigger/rest/go.mod | 2 -- trigger/timer/go.mod | 2 -- 4 files changed, 7 deletions(-) diff --git a/trigger/channel/go.mod b/trigger/channel/go.mod index 8f7ec3dc..a9fab9d9 100644 --- a/trigger/channel/go.mod +++ b/trigger/channel/go.mod @@ -4,5 +4,3 @@ require ( github.com/project-flogo/core v0.9.0-beta.1 github.com/stretchr/testify v1.3.0 ) - -replace github.com/project-flogo/core v0.9.0-beta.1 => /Users/skothari-tibco/Documents/core diff --git a/trigger/cli/go.mod b/trigger/cli/go.mod index 117ed1f0..f46b288f 100644 --- a/trigger/cli/go.mod +++ b/trigger/cli/go.mod @@ -7,4 +7,3 @@ require ( github.com/stretchr/testify v1.3.0 ) -replace github.com/project-flogo/core v0.9.0-beta.1 => /Users/skothari-tibco/Documents/core diff --git a/trigger/rest/go.mod b/trigger/rest/go.mod index 277d643f..891618ba 100644 --- a/trigger/rest/go.mod +++ b/trigger/rest/go.mod @@ -5,5 +5,3 @@ require ( github.com/project-flogo/core v0.9.0-beta.1 github.com/stretchr/testify v1.3.0 ) - -replace github.com/project-flogo/core v0.9.0-beta.1 => /Users/skothari-tibco/Documents/core diff --git a/trigger/timer/go.mod b/trigger/timer/go.mod index 68c97881..af781c2e 100644 --- a/trigger/timer/go.mod +++ b/trigger/timer/go.mod @@ -5,5 +5,3 @@ require ( github.com/project-flogo/core v0.9.0-beta.1 github.com/stretchr/testify v1.3.0 ) - -replace github.com/project-flogo/core v0.9.0-beta.1 => /Users/skothari-tibco/Documents/core From fe15a7437c6fd7f937e8e62580097447edf1a875 Mon Sep 17 00:00:00 2001 From: Frank Martinez Date: Tue, 2 Apr 2019 20:58:10 -0400 Subject: [PATCH 07/10] add initial README.md; some cleanup --- README.md | 66 +++++++++++++++++++++++++++++++++- activity/actreply/activity.go | 2 +- activity/actreply/go.mod | 2 +- activity/actreply/go.sum | 5 +-- activity/actreturn/activity.go | 2 +- activity/actreturn/go.mod | 4 +-- activity/actreturn/go.sum | 5 +-- activity/channel/activity.go | 2 +- activity/channel/go.mod | 4 +-- activity/channel/go.sum | 5 +-- activity/counter/go.mod | 4 +-- activity/counter/go.sum | 5 +-- activity/error/go.mod | 4 +-- activity/error/go.sum | 5 +-- activity/jsexec/go.mod | 10 +----- activity/jsexec/go.sum | 7 ++-- activity/log/activity.go | 2 +- activity/log/go.mod | 4 +-- activity/log/go.sum | 5 +-- activity/mapper/activity.go | 2 +- activity/mapper/go.mod | 4 +-- activity/mapper/go.sum | 12 ++----- activity/noop/activity.go | 2 +- activity/noop/go.mod | 2 +- activity/noop/go.sum | 5 +-- activity/rest/activity.go | 2 +- activity/rest/go.mod | 5 +-- activity/rest/go.sum | 12 ++----- function/coerce/go.mod | 6 +--- function/coerce/go.sum | 14 ++++---- function/json/go.mod | 2 +- function/json/go.sum | 6 ++-- function/number/go.mod | 2 +- function/number/go.sum | 14 ++++---- function/number/random.go | 2 +- function/string/go.mod | 4 +-- function/string/go.sum | 6 ++-- trigger/channel/go.mod | 2 +- trigger/channel/go.sum | 10 ++---- trigger/cli/go.mod | 5 +-- trigger/cli/go.sum | 15 +++----- trigger/loadtester/README.md | 2 +- trigger/loadtester/go.mod | 2 +- trigger/loadtester/go.sum | 4 +-- trigger/rest/go.mod | 2 +- trigger/rest/go.sum | 10 ++---- trigger/timer/go.mod | 2 +- trigger/timer/go.sum | 5 +-- 48 files changed, 156 insertions(+), 148 deletions(-) diff --git a/README.md b/README.md index 6da811fa..0e0a1947 100644 --- a/README.md +++ b/README.md @@ -1 +1,65 @@ -EXPERIMENTAL, DO NOT USE +# Flogo Contrib + +[![Build Status](https://travis-ci.org/project-flogo/contrib.svg?branch=master)](https://travis-ci.org/project-flogo/contrib.svg?branch=master) + +Core collection of Flogo contributions. This repository consists of activities, triggers and functions. + +## Contributions + +### Activities +* [actreply](activity/actreply): Action Reply +* [actreturn](activity/actreturn): Action Return +* [channel](activity/channel): Send internal engine messages +* [counter](activity/counter): Simple Counter +* [error](activity/error): Throw error +* [jsexec](activity/jsexec): Execute Javascript +* [log](activity/log): Log Message +* [mapper](activity/mapper): Mapper +* [noop](activity/noop): No-Op +* [rest](activity/rest): Basic REST invoker + +### Triggers +* [channel](trigger/channel): Listen to internal engine messages +* [cli](trigger/cli): CLI +* [loadtester](trigger/loadtester): Basic load tester +* [rest](trigger/rest): REST +* [timer](trigger/timer): Timer + +### Functions +* [coerce](function/coerce): Type Conversion +* [json](function/json): JSON functions +* [number](function/number): Number functions +* [string](function/string): Basic string functions + +## Installation + +#### Install Activity +Example: install **log** activity + +```bash +flogo install github.com/project-flogo/contrib/activity/log +``` +#### Install Trigger +Example: install **rest** trigger + +```bash +flogo install github.com/project-flogo/contrib/trigger/rest +``` +#### Install Functions +Example: install **string** functions + +```bash +flogo install github.com/project-flogo/contrib/function/string +``` + +## Contributing and support + +### Contributing + +New activities, triggers and functions are welcomed. If you would like to contribute, please following the [contribution guidelines](https://github.com/TIBCOSoftware/flogo/blob/master/CONTRIBUTING.md). If you have any questions, issues, etc feel free to chat with us on [Gitter](https://gitter.im/project-flogo/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link). + +## License +The contrib repository is licensed under a BSD-type license. See TIBCO LICENSE.txt for license text. + +### Support +For Q&A you can post your questions on [Gitter](https://gitter.im/project-flogo/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link) diff --git a/activity/actreply/activity.go b/activity/actreply/activity.go index 89672af6..74700e9a 100755 --- a/activity/actreply/activity.go +++ b/activity/actreply/activity.go @@ -7,7 +7,7 @@ import ( ) func init() { - activity.Register(&Activity{}, New) + _ = activity.Register(&Activity{}, New) } type Settings struct { diff --git a/activity/actreply/go.mod b/activity/actreply/go.mod index 906419d5..3932793d 100644 --- a/activity/actreply/go.mod +++ b/activity/actreply/go.mod @@ -1,6 +1,6 @@ module github.com/project-flogo/contrib/activity/actreply require ( - github.com/project-flogo/core v0.9.0-beta.1 + github.com/project-flogo/core v0.9.0-beta.2 github.com/stretchr/testify v1.3.0 ) diff --git a/activity/actreply/go.sum b/activity/actreply/go.sum index b661751c..7e5bc071 100644 --- a/activity/actreply/go.sum +++ b/activity/actreply/go.sum @@ -4,8 +4,9 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/activity/actreturn/activity.go b/activity/actreturn/activity.go index 6ec88daa..7eacec44 100755 --- a/activity/actreturn/activity.go +++ b/activity/actreturn/activity.go @@ -7,7 +7,7 @@ import ( ) func init() { - activity.Register(&Activity{}, New) + _ = activity.Register(&Activity{}, New) } type Settings struct { diff --git a/activity/actreturn/go.mod b/activity/actreturn/go.mod index 00f18156..0a875cfb 100644 --- a/activity/actreturn/go.mod +++ b/activity/actreturn/go.mod @@ -1,8 +1,6 @@ module github.com/project-flogo/contrib/activity/actreturn require ( - github.com/project-flogo/core v0.9.0-beta.1 + github.com/project-flogo/core v0.9.0-beta.2 github.com/stretchr/testify v1.3.0 - go.uber.org/atomic v1.3.2 // indirect - go.uber.org/multierr v1.1.0 // indirect ) diff --git a/activity/actreturn/go.sum b/activity/actreturn/go.sum index b661751c..7e5bc071 100644 --- a/activity/actreturn/go.sum +++ b/activity/actreturn/go.sum @@ -4,8 +4,9 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/activity/channel/activity.go b/activity/channel/activity.go index 020bc435..968f4e20 100644 --- a/activity/channel/activity.go +++ b/activity/channel/activity.go @@ -8,7 +8,7 @@ import ( ) func init() { - activity.Register(&Activity{}) + _ = activity.Register(&Activity{}) } var activityMd = activity.ToMetadata(&Input{}) diff --git a/activity/channel/go.mod b/activity/channel/go.mod index f08a56f7..959ab1b4 100644 --- a/activity/channel/go.mod +++ b/activity/channel/go.mod @@ -1,8 +1,6 @@ module github.com/project-flogo/contrib/activity/channel require ( - github.com/project-flogo/core v0.9.0-beta.1 + github.com/project-flogo/core v0.9.0-beta.2 github.com/stretchr/testify v1.3.0 - go.uber.org/atomic v1.3.2 // indirect - go.uber.org/multierr v1.1.0 // indirect ) diff --git a/activity/channel/go.sum b/activity/channel/go.sum index b661751c..7e5bc071 100644 --- a/activity/channel/go.sum +++ b/activity/channel/go.sum @@ -4,8 +4,9 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/activity/counter/go.mod b/activity/counter/go.mod index 28642d7c..65176664 100644 --- a/activity/counter/go.mod +++ b/activity/counter/go.mod @@ -1,8 +1,6 @@ module github.com/project-flogo/contrib/activity/counter require ( - github.com/project-flogo/core v0.9.0-beta.1 + github.com/project-flogo/core v0.9.0-beta.2 github.com/stretchr/testify v1.3.0 - go.uber.org/atomic v1.3.2 // indirect - go.uber.org/multierr v1.1.0 // indirect ) diff --git a/activity/counter/go.sum b/activity/counter/go.sum index b661751c..7e5bc071 100644 --- a/activity/counter/go.sum +++ b/activity/counter/go.sum @@ -4,8 +4,9 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/activity/error/go.mod b/activity/error/go.mod index 9ede3814..2cc5e325 100644 --- a/activity/error/go.mod +++ b/activity/error/go.mod @@ -1,8 +1,6 @@ module github.com/project-flogo/contrib/activity/error require ( - github.com/project-flogo/core v0.9.0-beta.1 + github.com/project-flogo/core v0.9.0-beta.2 github.com/stretchr/testify v1.3.0 - go.uber.org/atomic v1.3.2 // indirect - go.uber.org/multierr v1.1.0 // indirect ) diff --git a/activity/error/go.sum b/activity/error/go.sum index b661751c..7e5bc071 100644 --- a/activity/error/go.sum +++ b/activity/error/go.sum @@ -4,8 +4,9 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/activity/jsexec/go.mod b/activity/jsexec/go.mod index 42aacb6e..a7fed324 100755 --- a/activity/jsexec/go.mod +++ b/activity/jsexec/go.mod @@ -1,15 +1,7 @@ module github.com/project-flogo/contrib/activity/jsexec require ( - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/dlclark/regexp2 v1.1.6 // indirect github.com/dop251/goja v0.0.0-20190301185519-64be363d126e - github.com/go-sourcemap/sourcemap v2.1.2+incompatible // indirect - github.com/pkg/errors v0.8.0 // indirect - github.com/project-flogo/core v0.9.0-beta.1 + github.com/project-flogo/core v0.9.0-beta.2 github.com/stretchr/testify v1.3.0 - go.uber.org/atomic v1.3.2 // indirect - go.uber.org/multierr v1.1.0 // indirect - golang.org/x/text v0.3.0 // indirect - gopkg.in/yaml.v2 v2.2.2 // indirect ) diff --git a/activity/jsexec/go.sum b/activity/jsexec/go.sum index 05726178..a26e50a5 100755 --- a/activity/jsexec/go.sum +++ b/activity/jsexec/go.sum @@ -7,11 +7,12 @@ github.com/dop251/goja v0.0.0-20190301185519-64be363d126e h1:tRjuynZo0xMi0l1ByvF github.com/dop251/goja v0.0.0-20190301185519-64be363d126e/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= github.com/go-sourcemap/sourcemap v2.1.2+incompatible h1:0b/xya7BKGhXuqFESKM4oIiRo9WOt2ebz7KxfreD6ug= github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= +github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -24,5 +25,7 @@ go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/activity/log/activity.go b/activity/log/activity.go index 6175c762..ec2dadd9 100755 --- a/activity/log/activity.go +++ b/activity/log/activity.go @@ -8,7 +8,7 @@ import ( ) func init() { - activity.Register(&Activity{}) + _ = activity.Register(&Activity{}) } type Input struct { diff --git a/activity/log/go.mod b/activity/log/go.mod index 386e358d..52d9faec 100644 --- a/activity/log/go.mod +++ b/activity/log/go.mod @@ -1,8 +1,6 @@ module github.com/project-flogo/contrib/activity/log require ( - github.com/project-flogo/core v0.9.0-beta.1 + github.com/project-flogo/core v0.9.0-beta.2 github.com/stretchr/testify v1.3.0 - go.uber.org/atomic v1.3.2 // indirect - go.uber.org/multierr v1.1.0 // indirect ) diff --git a/activity/log/go.sum b/activity/log/go.sum index b661751c..7e5bc071 100644 --- a/activity/log/go.sum +++ b/activity/log/go.sum @@ -4,8 +4,9 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/activity/mapper/activity.go b/activity/mapper/activity.go index 9cce139e..f89fb5cb 100755 --- a/activity/mapper/activity.go +++ b/activity/mapper/activity.go @@ -7,7 +7,7 @@ import ( ) func init() { - activity.Register(&Activity{}, New) + _ = activity.Register(&Activity{}, New) } type Settings struct { diff --git a/activity/mapper/go.mod b/activity/mapper/go.mod index 9901aee5..7814fc8a 100644 --- a/activity/mapper/go.mod +++ b/activity/mapper/go.mod @@ -1,8 +1,6 @@ module github.com/project-flogo/contrib/activity/mapper require ( - github.com/project-flogo/core v0.9.0-beta.1 + github.com/project-flogo/core v0.9.0-beta.2 github.com/stretchr/testify v1.3.0 - go.uber.org/atomic v1.3.2 // indirect - go.uber.org/multierr v1.1.0 // indirect ) diff --git a/activity/mapper/go.sum b/activity/mapper/go.sum index 920f6070..7e5bc071 100644 --- a/activity/mapper/go.sum +++ b/activity/mapper/go.sum @@ -1,19 +1,13 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-alpha.6 h1:ugQmmE1WQ75gzHwFpIv7Wbt1wTqNmWj94J8t6sKdKPw= -github.com/project-flogo/core v0.9.0-alpha.6/go.mod h1:eB+hMcq51lOIeJ93K8Nvvm/vC3OI60ZaEgBbA4gtk8k= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= -github.com/square-it/jsonschema v1.9.1/go.mod h1:80WJHSuy3YnokzfFopfx+MAt5lVVnVpS6w2Avv+svHk= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= diff --git a/activity/noop/activity.go b/activity/noop/activity.go index 18bf9dcd..dac56c5e 100755 --- a/activity/noop/activity.go +++ b/activity/noop/activity.go @@ -5,7 +5,7 @@ import ( ) func init() { - activity.Register(&Activity{}) + _ = activity.Register(&Activity{}) } var activityMd = activity.ToMetadata() diff --git a/activity/noop/go.mod b/activity/noop/go.mod index 7ac5de66..8f397b76 100644 --- a/activity/noop/go.mod +++ b/activity/noop/go.mod @@ -1,6 +1,6 @@ module github.com/project-flogo/contrib/activity/noop require ( - github.com/project-flogo/core v0.9.0-beta.1 + github.com/project-flogo/core v0.9.0-beta.2 github.com/stretchr/testify v1.3.0 ) diff --git a/activity/noop/go.sum b/activity/noop/go.sum index b661751c..7e5bc071 100644 --- a/activity/noop/go.sum +++ b/activity/noop/go.sum @@ -4,8 +4,9 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/activity/rest/activity.go b/activity/rest/activity.go index adffe112..6ebcf84a 100644 --- a/activity/rest/activity.go +++ b/activity/rest/activity.go @@ -17,7 +17,7 @@ import ( ) func init() { - activity.Register(&Activity{}, New) + _ = activity.Register(&Activity{}, New) } const ( diff --git a/activity/rest/go.mod b/activity/rest/go.mod index 4c95d3bf..4df9f7c6 100644 --- a/activity/rest/go.mod +++ b/activity/rest/go.mod @@ -1,9 +1,6 @@ module github.com/project-flogo/contrib/activity/rest require ( - github.com/project-flogo/core v0.9.0-beta.1 - github.com/square-it/jsonschema v1.9.1 // indirect + github.com/project-flogo/core v0.9.0-beta.2 github.com/stretchr/testify v1.3.0 - go.uber.org/atomic v1.3.2 // indirect - go.uber.org/multierr v1.1.0 // indirect ) diff --git a/activity/rest/go.sum b/activity/rest/go.sum index 920f6070..7e5bc071 100644 --- a/activity/rest/go.sum +++ b/activity/rest/go.sum @@ -1,19 +1,13 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-alpha.6 h1:ugQmmE1WQ75gzHwFpIv7Wbt1wTqNmWj94J8t6sKdKPw= -github.com/project-flogo/core v0.9.0-alpha.6/go.mod h1:eB+hMcq51lOIeJ93K8Nvvm/vC3OI60ZaEgBbA4gtk8k= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= -github.com/square-it/jsonschema v1.9.1/go.mod h1:80WJHSuy3YnokzfFopfx+MAt5lVVnVpS6w2Avv+svHk= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= diff --git a/function/coerce/go.mod b/function/coerce/go.mod index 1b0f49ab..412edb30 100644 --- a/function/coerce/go.mod +++ b/function/coerce/go.mod @@ -1,7 +1,3 @@ module github.com/project-flogo/contrib/function/coerce -require ( - github.com/project-flogo/core v0.9.0-beta.1 - go.uber.org/atomic v1.3.2 // indirect - go.uber.org/multierr v1.1.0 // indirect -) +require github.com/project-flogo/core v0.9.0-beta.2 diff --git a/function/coerce/go.sum b/function/coerce/go.sum index a2925fa0..46c68763 100644 --- a/function/coerce/go.sum +++ b/function/coerce/go.sum @@ -1,14 +1,14 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:ToDfk5H61p8j6uhPZzIeHQ8TBCj8M4DzUcna4+2KbO8= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:eB+hMcq51lOIeJ93K8Nvvm/vC3OI60ZaEgBbA4gtk8k= -github.com/square-it/jsonschema v1.9.1/go.mod h1:80WJHSuy3YnokzfFopfx+MAt5lVVnVpS6w2Avv+svHk= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= diff --git a/function/json/go.mod b/function/json/go.mod index 3794a756..8da67f04 100644 --- a/function/json/go.mod +++ b/function/json/go.mod @@ -2,6 +2,6 @@ module github.com/project-flogo/contrib/function/json require ( github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 - github.com/project-flogo/core v0.9.0-beta.1 + github.com/project-flogo/core v0.9.0-beta.2 github.com/stretchr/testify v1.3.0 ) diff --git a/function/json/go.sum b/function/json/go.sum index dca1362c..a719c8c1 100644 --- a/function/json/go.sum +++ b/function/json/go.sum @@ -6,11 +6,9 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:ToDfk5H61p8j6uhPZzIeHQ8TBCj8M4DzUcna4+2KbO8= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:eB+hMcq51lOIeJ93K8Nvvm/vC3OI60ZaEgBbA4gtk8k= -github.com/square-it/jsonschema v1.9.1/go.mod h1:80WJHSuy3YnokzfFopfx+MAt5lVVnVpS6w2Avv+svHk= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= diff --git a/function/number/go.mod b/function/number/go.mod index afb648e9..f8e0d405 100644 --- a/function/number/go.mod +++ b/function/number/go.mod @@ -1,3 +1,3 @@ module github.com/project-flogo/contrib/function/number -require github.com/project-flogo/core v0.9.0-beta.1 +require github.com/project-flogo/core v0.9.0-beta.2 diff --git a/function/number/go.sum b/function/number/go.sum index a2925fa0..46c68763 100644 --- a/function/number/go.sum +++ b/function/number/go.sum @@ -1,14 +1,14 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:ToDfk5H61p8j6uhPZzIeHQ8TBCj8M4DzUcna4+2KbO8= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:eB+hMcq51lOIeJ93K8Nvvm/vC3OI60ZaEgBbA4gtk8k= -github.com/square-it/jsonschema v1.9.1/go.mod h1:80WJHSuy3YnokzfFopfx+MAt5lVVnVpS6w2Avv+svHk= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= diff --git a/function/number/random.go b/function/number/random.go index 6aaac270..07eb1cf3 100644 --- a/function/number/random.go +++ b/function/number/random.go @@ -16,7 +16,7 @@ type fnRandom struct { } func (fnRandom) Name() string { - return "number.random" + return "random" } func (fnRandom) Sig() (paramTypes []data.Type, isVariadic bool) { diff --git a/function/string/go.mod b/function/string/go.mod index baab60f6..241bf272 100644 --- a/function/string/go.mod +++ b/function/string/go.mod @@ -1,8 +1,6 @@ module github.com/project-flogo/contrib/function/string require ( - github.com/project-flogo/core v0.9.0-beta.1 + github.com/project-flogo/core v0.9.0-beta.2 github.com/stretchr/testify v1.3.0 - go.uber.org/atomic v1.3.2 // indirect - go.uber.org/multierr v1.1.0 // indirect ) diff --git a/function/string/go.sum b/function/string/go.sum index 99d6d9f5..46c68763 100644 --- a/function/string/go.sum +++ b/function/string/go.sum @@ -4,11 +4,9 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:ToDfk5H61p8j6uhPZzIeHQ8TBCj8M4DzUcna4+2KbO8= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:eB+hMcq51lOIeJ93K8Nvvm/vC3OI60ZaEgBbA4gtk8k= -github.com/square-it/jsonschema v1.9.1/go.mod h1:80WJHSuy3YnokzfFopfx+MAt5lVVnVpS6w2Avv+svHk= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= diff --git a/trigger/channel/go.mod b/trigger/channel/go.mod index a9fab9d9..01578d85 100644 --- a/trigger/channel/go.mod +++ b/trigger/channel/go.mod @@ -1,6 +1,6 @@ module github.com/project-flogo/contrib/trigger/channel require ( - github.com/project-flogo/core v0.9.0-beta.1 + github.com/project-flogo/core v0.9.0-beta.2 github.com/stretchr/testify v1.3.0 ) diff --git a/trigger/channel/go.sum b/trigger/channel/go.sum index 176d5678..46c68763 100644 --- a/trigger/channel/go.sum +++ b/trigger/channel/go.sum @@ -1,20 +1,14 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= -github.com/square-it/jsonschema v1.9.1/go.mod h1:80WJHSuy3YnokzfFopfx+MAt5lVVnVpS6w2Avv+svHk= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= diff --git a/trigger/cli/go.mod b/trigger/cli/go.mod index f46b288f..b4330fab 100644 --- a/trigger/cli/go.mod +++ b/trigger/cli/go.mod @@ -1,9 +1,6 @@ module github.com/project-flogo/contrib/trigger/cli require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/project-flogo/core v0.9.0-beta.1 - github.com/stretchr/objx v0.1.1 // indirect + github.com/project-flogo/core v0.9.0-beta.2 github.com/stretchr/testify v1.3.0 ) - diff --git a/trigger/cli/go.sum b/trigger/cli/go.sum index 9f9cfb90..7e5bc071 100644 --- a/trigger/cli/go.sum +++ b/trigger/cli/go.sum @@ -1,20 +1,13 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-alpha.6 h1:ugQmmE1WQ75gzHwFpIv7Wbt1wTqNmWj94J8t6sKdKPw= -github.com/project-flogo/core v0.9.0-alpha.6/go.mod h1:eB+hMcq51lOIeJ93K8Nvvm/vC3OI60ZaEgBbA4gtk8k= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= -github.com/square-it/jsonschema v1.9.1/go.mod h1:80WJHSuy3YnokzfFopfx+MAt5lVVnVpS6w2Avv+svHk= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= diff --git a/trigger/loadtester/README.md b/trigger/loadtester/README.md index aeae6a0e..cc178878 100644 --- a/trigger/loadtester/README.md +++ b/trigger/loadtester/README.md @@ -5,7 +5,7 @@ weight: 4706 # LoadTester Trigger This trigger provides your flogo application the ability to run simple load test on a specified action -Implementation based off github.com/tsliwowicz/go-wrk +Implementation based off [go-wrk](github.com/tsliwowicz/go-wrk). ## Installation diff --git a/trigger/loadtester/go.mod b/trigger/loadtester/go.mod index 0eadc361..0a5efb6a 100644 --- a/trigger/loadtester/go.mod +++ b/trigger/loadtester/go.mod @@ -1,7 +1,7 @@ module github.com/project-flogo/contrib/trigger/loadtester require ( - github.com/project-flogo/core v0.9.0-beta.1 + github.com/project-flogo/core v0.9.0-beta.2 go.uber.org/atomic v1.3.2 // indirect go.uber.org/multierr v1.1.0 // indirect ) diff --git a/trigger/loadtester/go.sum b/trigger/loadtester/go.sum index b661751c..46c68763 100644 --- a/trigger/loadtester/go.sum +++ b/trigger/loadtester/go.sum @@ -4,8 +4,8 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/trigger/rest/go.mod b/trigger/rest/go.mod index 891618ba..f6d1f8d6 100644 --- a/trigger/rest/go.mod +++ b/trigger/rest/go.mod @@ -2,6 +2,6 @@ module github.com/project-flogo/contrib/trigger/rest require ( github.com/julienschmidt/httprouter v1.2.0 - github.com/project-flogo/core v0.9.0-beta.1 + github.com/project-flogo/core v0.9.0-beta.2 github.com/stretchr/testify v1.3.0 ) diff --git a/trigger/rest/go.sum b/trigger/rest/go.sum index 03a78179..ca234c11 100644 --- a/trigger/rest/go.sum +++ b/trigger/rest/go.sum @@ -1,23 +1,17 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= -github.com/square-it/jsonschema v1.9.1/go.mod h1:80WJHSuy3YnokzfFopfx+MAt5lVVnVpS6w2Avv+svHk= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= diff --git a/trigger/timer/go.mod b/trigger/timer/go.mod index af781c2e..4393bbf5 100644 --- a/trigger/timer/go.mod +++ b/trigger/timer/go.mod @@ -2,6 +2,6 @@ module github.com/project-flogo/contrib/trigger/timer require ( github.com/carlescere/scheduler v0.0.0-20170109141437-ee74d2f83d82 - github.com/project-flogo/core v0.9.0-beta.1 + github.com/project-flogo/core v0.9.0-beta.2 github.com/stretchr/testify v1.3.0 ) diff --git a/trigger/timer/go.sum b/trigger/timer/go.sum index 7fed540d..4ea49160 100644 --- a/trigger/timer/go.sum +++ b/trigger/timer/go.sum @@ -6,8 +6,9 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/project-flogo/core v0.9.0-beta.1 h1:tiRv5Lv6U1SnDJh6vB10y8AnEdF8/Zmahj8WgCDqS6I= -github.com/project-flogo/core v0.9.0-beta.1/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/project-flogo/core v0.9.0-beta.2 h1:L5VLOfF3YfAFVJwn/tL3x0835sZIedrHcrPkYxHbPl4= +github.com/project-flogo/core v0.9.0-beta.2/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= From 9610a198af5a8eb5c5c4af2e87dddb4ade77324e Mon Sep 17 00:00:00 2001 From: Frank Martinez Date: Tue, 2 Apr 2019 21:04:02 -0400 Subject: [PATCH 08/10] add license file; fix readme --- LICENSE | 29 +++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..d6f645c3 --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2018, TIBCO Software Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of TIBCO Software Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 0e0a1947..ffd4ca96 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ flogo install github.com/project-flogo/contrib/function/string New activities, triggers and functions are welcomed. If you would like to contribute, please following the [contribution guidelines](https://github.com/TIBCOSoftware/flogo/blob/master/CONTRIBUTING.md). If you have any questions, issues, etc feel free to chat with us on [Gitter](https://gitter.im/project-flogo/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link). ## License -The contrib repository is licensed under a BSD-type license. See TIBCO LICENSE.txt for license text. +The contrib repository is licensed under a BSD-type license. See [LICENSE](LICENSE) for license text. ### Support For Q&A you can post your questions on [Gitter](https://gitter.im/project-flogo/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link) From 2275b378a57179b975199eea4c5229b4b68efa80 Mon Sep 17 00:00:00 2001 From: Frank Martinez Date: Wed, 3 Apr 2019 13:55:23 -0400 Subject: [PATCH 09/10] add appdata activity; additional cleanup --- README.md | 1 + activity/actreply/README.md | 3 - activity/actreturn/README.md | 3 - activity/appdata/README.md | 69 +++++++++++++++++++ activity/appdata/activity.go | 109 ++++++++++++++++++++++++++++++ activity/appdata/activity_test.go | 72 ++++++++++++++++++++ activity/appdata/descriptor.json | 42 ++++++++++++ activity/appdata/go.mod | 6 ++ activity/appdata/go.sum | 19 ++++++ activity/channel/activity.go | 7 +- activity/channel/go.mod | 2 +- activity/counter/README.md | 3 - activity/counter/activity.go | 2 +- activity/error/README.md | 3 - activity/jsexec/metadata.go | 8 +-- activity/log/README.md | 3 - activity/mapper/README.md | 3 - activity/noop/README.md | 3 - activity/rest/README.md | 3 - activity/rest/metadata.go | 36 +++++----- 20 files changed, 347 insertions(+), 50 deletions(-) create mode 100755 activity/appdata/README.md create mode 100755 activity/appdata/activity.go create mode 100755 activity/appdata/activity_test.go create mode 100755 activity/appdata/descriptor.json create mode 100644 activity/appdata/go.mod create mode 100644 activity/appdata/go.sum diff --git a/README.md b/README.md index ffd4ca96..17880a59 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Core collection of Flogo contributions. This repository consists of activities, ### Activities * [actreply](activity/actreply): Action Reply * [actreturn](activity/actreturn): Action Return +* [appdata](activity/actreturn): App Shared Data * [channel](activity/channel): Send internal engine messages * [counter](activity/counter): Simple Counter * [error](activity/error): Throw error diff --git a/activity/actreply/README.md b/activity/actreply/README.md index 2186653c..5a2235ac 100755 --- a/activity/actreply/README.md +++ b/activity/actreply/README.md @@ -8,9 +8,6 @@ This activity allows you to reply to a trigger invocation and map output values. ## Installation -### Flogo Web -This activity comes out of the box with the Flogo Web UI - ### Flogo CLI ```bash flogo install github.com/project-flogo/contrib/activity/actreply diff --git a/activity/actreturn/README.md b/activity/actreturn/README.md index feee721c..a6187b84 100755 --- a/activity/actreturn/README.md +++ b/activity/actreturn/README.md @@ -8,9 +8,6 @@ This activity allows you to reply to a trigger invocation and map output values. ## Installation -### Flogo Web -This activity comes out of the box with the Flogo Web UI - ### Flogo CLI ```bash flogo install github.com/project-flogo/contrib/activity/actreturn diff --git a/activity/appdata/README.md b/activity/appdata/README.md new file mode 100755 index 00000000..cc945ab3 --- /dev/null +++ b/activity/appdata/README.md @@ -0,0 +1,69 @@ +# AppData +This activity allows you to set and get global App attributes\. + +## Installation + +### Flogo CLI +```bash +flogo install github.com/project-flogo/contrib/activity/appdata +``` + +## Configuration + +### Settings: +| Name | Type | Description +|:--- | :--- | :--- +| name | string | The name of the shared attribute - **REQUIRED** +| op | string | The operation (get or set), 'get' is the default +| type | string | The data type of the shared value, default is 'any' + +### Input: +| Name | Type | Description +|:--- | :--- | :--- +| value | object | The value of the shared attribute + + +### Output: +| Name | Type | Description +|:--- | :--- | :--- +| value | object | The value of the shared attribute + + +## Examples + +### Get +Get the value of the 'myAttr' attribute: + +```json +{ + "id": "get_app_attr", + "name": "Get App Attr", + "activity": { + "ref": "github.com/project-flogo/contrib/activity/appdata", + "settings": { + "attribute": "myAttr", + "operation": "get" + } + } +} +``` + +### Set +Update the value of the 'myAttr' attribute to _bar_: + +```json +{ + "id": "set_app_attr", + "name": "Set App Attr", + "activity": { + "ref": "github.com/project-flogo/contrib/activity/appdata", + "settings": { + "attribute": "myAttr", + "operation": "set" + }, + "input": { + "value": "bar" + } + } +} +``` diff --git a/activity/appdata/activity.go b/activity/appdata/activity.go new file mode 100755 index 00000000..00b93670 --- /dev/null +++ b/activity/appdata/activity.go @@ -0,0 +1,109 @@ +package appdata + +import ( + "github.com/project-flogo/core/activity" + "github.com/project-flogo/core/app" + "github.com/project-flogo/core/data" + "github.com/project-flogo/core/data/coerce" + "github.com/project-flogo/core/data/metadata" +) + +const ( + opGet int = 0 + opSet int = 1 + + ivValue = "value" + ovValue = "value" +) + +type Settings struct { + Name string `md:"name,required"` // The name of the shared attribute + Op string `md:"op,allowed(get,set)"` // The operation (get or set), 'get' is the default + Type string `md:"type"` // The data type of the shared value, default is 'any' +} + +type Input struct { + Value interface{} `md:"value"` // The value of the shared attribute +} + +type Output struct { + Value interface{} `md:"value"` // The value of the shared attribute +} + +func init() { + _ = activity.Register(&Activity{}, New) +} + +var activityMd = activity.ToMetadata(&Settings{}, &Output{}) + +// Activity is a Counter Activity implementation +type Activity struct { + op int + dt data.Type + attrName string +} + +func New(ctx activity.InitContext) (activity.Activity, error) { + s := &Settings{} + err := metadata.MapToStruct(ctx.Settings(), s, true) + if err != nil { + return nil, err + } + + act := &Activity{attrName: s.Name} + + if s.Op == "set" { + act.op = opSet + } + + if s.Type != "" { + t, err := data.ToTypeEnum(s.Type) + if err != nil { + return nil, err + } + act.dt = t + } + + return act, nil +} + +// Metadata implements activity.Activity.Metadata +func (a *Activity) Metadata() *activity.Metadata { + return activityMd +} + +// Eval implements activity.Activity.Eval +func (a *Activity) Eval(ctx activity.Context) (done bool, err error) { + + switch a.op { + case opGet: + + val, exists := app.GetValue(a.attrName) + if exists && a.dt > 1 { + val, err = coerce.ToType(val, a.dt) + if err != nil { + return false, err + } + } + err = ctx.SetOutput(ovValue, val) + if err != nil { + return false, err + } + case opSet: + val := ctx.GetInput(ivValue) + + if a.dt > 1 { + val, err = coerce.ToType(val, a.dt) + if err != nil { + return false, err + } + } + + err = app.SetValue(a.attrName, val) + if err != nil { + return false, err + } + } + + return true, nil +} diff --git a/activity/appdata/activity_test.go b/activity/appdata/activity_test.go new file mode 100755 index 00000000..56861f35 --- /dev/null +++ b/activity/appdata/activity_test.go @@ -0,0 +1,72 @@ +package appdata + +import ( + "github.com/project-flogo/core/activity" + "github.com/project-flogo/core/app" + "github.com/project-flogo/core/support/test" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestRegister(t *testing.T) { + + ref := activity.GetRef(&Activity{}) + act := activity.Get(ref) + + assert.NotNil(t, act) +} + +func TestSet(t *testing.T) { + + defer func() { + if r := recover(); r != nil { + t.Failed() + t.Errorf("panic during execution: %v", r) + } + }() + + settings := &Settings{Name: "test", Op: "set"} + iCtx := test.NewActivityInitContext(settings, nil) + + act, err := New(iCtx) + assert.Nil(t, err) + + tc := test.NewActivityContext(act.Metadata()) + tc.SetInput("value", "foo") + + _, err = act.Eval(tc) + assert.Nil(t, err) + + appValue, _ := app.GetValue("test") + assert.Equal(t, "foo", appValue) + +} + +func TestGet(t *testing.T) { + + defer func() { + if r := recover(); r != nil { + t.Failed() + t.Errorf("panic during execution: %v", r) + } + }() + + err := app.SetValue("test", "bar") + assert.Nil(t, err) + + settings := &Settings{Name: "test", Op: "get"} + iCtx := test.NewActivityInitContext(settings, nil) + + act, err := New(iCtx) + assert.Nil(t, err) + + tc := test.NewActivityContext(act.Metadata()) + tc.SetInput("value", "bar") + + _, err = act.Eval(tc) + assert.Nil(t, err) + + appValue, _ := app.GetValue("test") + assert.Equal(t, "bar", appValue) +} diff --git a/activity/appdata/descriptor.json b/activity/appdata/descriptor.json new file mode 100755 index 00000000..ea04812a --- /dev/null +++ b/activity/appdata/descriptor.json @@ -0,0 +1,42 @@ +{ + "name": "flogo-appdata", + "type": "flogo:activity", + "version": "0.0.1", + "title": "Use global App attribute", + "description": "Use global App attribute", + "homepage": "https://github.com/project-flogo/contrib/tree/master/activity/appdata", + "settings":[ + { + "name": "name", + "type": "string", + "required": true, + "description": "The name of the shared attribute" + }, + { + "name": "op", + "type": "string", + "allowed" : ["get", "set"], + "description": "The operation (get or set), 'get' is the default" + }, + { + "name": "type", + "type": "string", + "allowed" : [ "any","string", "int", "float64", "boolean", "object", "array", "params"], + "description": "The data type of the shared value, default is 'any'" + } + ], + "input": [ + { + "name": "value", + "type": "object", + "description": "The value of the shared attribute" + } + ], + "output": [ + { + "name": "value", + "type": "object", + "description": "The value of the shared attribute" + } + ] +} \ No newline at end of file diff --git a/activity/appdata/go.mod b/activity/appdata/go.mod new file mode 100644 index 00000000..6bbf2e82 --- /dev/null +++ b/activity/appdata/go.mod @@ -0,0 +1,6 @@ +module github.com/project-flogo/contrib/activity/channel + +require ( + github.com/project-flogo/core v0.9.0-beta.3 + github.com/stretchr/testify v1.3.0 +) diff --git a/activity/appdata/go.sum b/activity/appdata/go.sum new file mode 100644 index 00000000..fb696537 --- /dev/null +++ b/activity/appdata/go.sum @@ -0,0 +1,19 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/project-flogo/core v0.9.0-beta.3 h1:RXBJBMLkMnEkI9MC/8xhGtLkk4XnMmug5Cvx4Of7yJo= +github.com/project-flogo/core v0.9.0-beta.3/go.mod h1:dzmBbQfNNC0g0KClKYQxxGJLe53MHafg75Vhmw2TW8U= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= +go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= diff --git a/activity/channel/activity.go b/activity/channel/activity.go index 968f4e20..b93503e8 100644 --- a/activity/channel/activity.go +++ b/activity/channel/activity.go @@ -28,7 +28,10 @@ func (a *Activity) Metadata() *activity.Metadata { func (a *Activity) Eval(ctx activity.Context) (done bool, err error) { input := &Input{} - ctx.GetInputObject(input) + err = ctx.GetInputObject(input) + if err != nil { + return false, err + } if len(input.Channel) == 0 { return false, fmt.Errorf("channel name must be specified") @@ -42,7 +45,7 @@ func (a *Activity) Eval(ctx activity.Context) (done bool, err error) { blocking := true - //should we allow + //todo should we allow publish new wait? if blocking { ch.Publish(input.Data) } else { diff --git a/activity/channel/go.mod b/activity/channel/go.mod index 959ab1b4..61873a3d 100644 --- a/activity/channel/go.mod +++ b/activity/channel/go.mod @@ -1,4 +1,4 @@ -module github.com/project-flogo/contrib/activity/channel +module github.com/project-flogo/contrib/activity/app require ( github.com/project-flogo/core v0.9.0-beta.2 diff --git a/activity/counter/README.md b/activity/counter/README.md index 2bccd95e..c891a699 100755 --- a/activity/counter/README.md +++ b/activity/counter/README.md @@ -8,9 +8,6 @@ This activity allows you to use a global counter. ## Installation -### Flogo Web -This activity comes out of the box with the Flogo Web UI - ### Flogo CLI ```bash flogo install github.com/project-flogo/contrib/activity/counter diff --git a/activity/counter/activity.go b/activity/counter/activity.go index 6de4b9d9..76c37fed 100755 --- a/activity/counter/activity.go +++ b/activity/counter/activity.go @@ -25,7 +25,7 @@ type Output struct { } func init() { - activity.Register(&Activity{}, New) + _ = activity.Register(&Activity{}, New) } var activityMd = activity.ToMetadata(&Settings{}, &Output{}) diff --git a/activity/error/README.md b/activity/error/README.md index b13c930d..cfd1430b 100644 --- a/activity/error/README.md +++ b/activity/error/README.md @@ -9,9 +9,6 @@ This activity allows you to cause an explicit error in the flow (throw an error) ## Installation -### Flogo Web -This activity comes out of the box with the Flogo Web UI - ### Flogo CLI ```bash flogo install github.com/project-flogo/contrib/activity/error diff --git a/activity/jsexec/metadata.go b/activity/jsexec/metadata.go index 76b596d7..06fc643d 100755 --- a/activity/jsexec/metadata.go +++ b/activity/jsexec/metadata.go @@ -15,19 +15,19 @@ type Input struct { } // FromMap converts the values from a map into the struct Input -func (r *Input) FromMap(values map[string]interface{}) error { +func (i *Input) FromMap(values map[string]interface{}) error { parameters, err := coerce.ToObject(values["parameters"]) if err != nil { return err } - r.Parameters = parameters + i.Parameters = parameters return nil } // ToMap converts the struct Input into a map -func (r *Input) ToMap() map[string]interface{} { +func (i *Input) ToMap() map[string]interface{} { return map[string]interface{}{ - "parameters": r.Parameters, + "parameters": i.Parameters, } } diff --git a/activity/log/README.md b/activity/log/README.md index b90a37cf..5368cb29 100644 --- a/activity/log/README.md +++ b/activity/log/README.md @@ -8,9 +8,6 @@ This activity allows you to write log messages. ## Installation -### Flogo Web -This activity comes out of the box with the Flogo Web UI - ### Flogo CLI ```bash flogo install github.com/project-flogo/contrib/activity/log diff --git a/activity/mapper/README.md b/activity/mapper/README.md index 01dc682b..9ff2f848 100755 --- a/activity/mapper/README.md +++ b/activity/mapper/README.md @@ -8,9 +8,6 @@ This activity allows you to map values to the working attribute set of an action ## Installation -### Flogo Web -This activity comes out of the box with the Flogo Web UI - ### Flogo CLI ```bash flogo install github.com/project-flogo/contrib/activity/mapper diff --git a/activity/noop/README.md b/activity/noop/README.md index 734146f9..8bd3b11d 100644 --- a/activity/noop/README.md +++ b/activity/noop/README.md @@ -8,9 +8,6 @@ This activity is a simple No-Op that can be used for testing. ## Installation -### Flogo Web -This activity comes out of the box with the Flogo Web UI - ### Flogo CLI ```bash flogo install github.com/project-flogo/contrib/activity/noop diff --git a/activity/rest/README.md b/activity/rest/README.md index b9d83cec..1f1f72dc 100644 --- a/activity/rest/README.md +++ b/activity/rest/README.md @@ -8,9 +8,6 @@ This activity allows you to invoke a REST service. ## Installation -### Flogo Web -This activity comes out of the box with the Flogo Web UI - ### Flogo CLI ```bash flogo install github.com/project-flogo/contrib/activity/rest diff --git a/activity/rest/metadata.go b/activity/rest/metadata.go index 031fe924..1c39051a 100644 --- a/activity/rest/metadata.go +++ b/activity/rest/metadata.go @@ -24,55 +24,55 @@ type Input struct { Content interface{} `md:"content"` // The message content to send. This is only used in POST, PUT, and PATCH } -func (o *Input) ToMap() map[string]interface{} { +func (i *Input) ToMap() map[string]interface{} { return map[string]interface{}{ - "pathParams": o.PathParams, - "queryParams": o.QueryParams, - "headers": o.Headers, - "content": o.Content, + "pathParams": i.PathParams, + "queryParams": i.QueryParams, + "headers": i.Headers, + "content": i.Content, } } -func (o *Input) FromMap(values map[string]interface{}) error { +func (i *Input) FromMap(values map[string]interface{}) error { var err error - o.PathParams, err = coerce.ToParams(values["pathParams"]) + i.PathParams, err = coerce.ToParams(values["pathParams"]) if err != nil { return err } - o.QueryParams, err = coerce.ToParams(values["queryParams"]) + i.QueryParams, err = coerce.ToParams(values["queryParams"]) if err != nil { return err } - o.Headers, err = coerce.ToParams(values["headers"]) + i.Headers, err = coerce.ToParams(values["headers"]) if err != nil { return err } - o.Content = values["content"] + i.Content = values["content"] return nil } type Output struct { - Status int `md:"status"` // The HTTP status code - Data interface{} `md:"result"` // The HTTP response data + Status int `md:"status"` // The HTTP status code + Data interface{} `md:"data"` // The HTTP response data } -func (r *Output) ToMap() map[string]interface{} { +func (o *Output) ToMap() map[string]interface{} { return map[string]interface{}{ - "status": r.Status, - "data": r.Data, + "status": o.Status, + "data": o.Data, } } -func (r *Output) FromMap(values map[string]interface{}) error { +func (o *Output) FromMap(values map[string]interface{}) error { var err error - r.Status, err = coerce.ToInt(values["status"]) + o.Status, err = coerce.ToInt(values["status"]) if err != nil { return err } - r.Data, _ = values["data"] + o.Data, _ = values["data"] return nil } From 6cbaf538878a6f81b1dd09456026c79a215353f4 Mon Sep 17 00:00:00 2001 From: Frank Martinez Date: Wed, 3 Apr 2019 14:18:41 -0400 Subject: [PATCH 10/10] fix go.mod --- activity/appdata/go.mod | 2 +- activity/channel/go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/activity/appdata/go.mod b/activity/appdata/go.mod index 6bbf2e82..9e383d81 100644 --- a/activity/appdata/go.mod +++ b/activity/appdata/go.mod @@ -1,4 +1,4 @@ -module github.com/project-flogo/contrib/activity/channel +module github.com/project-flogo/contrib/activity/appdata require ( github.com/project-flogo/core v0.9.0-beta.3 diff --git a/activity/channel/go.mod b/activity/channel/go.mod index 61873a3d..959ab1b4 100644 --- a/activity/channel/go.mod +++ b/activity/channel/go.mod @@ -1,4 +1,4 @@ -module github.com/project-flogo/contrib/activity/app +module github.com/project-flogo/contrib/activity/channel require ( github.com/project-flogo/core v0.9.0-beta.2