From 40b63a841a7bf15ac3c94d4047219b1766f45259 Mon Sep 17 00:00:00 2001 From: Rafael Date: Sun, 16 May 2021 17:28:03 +1200 Subject: [PATCH 1/8] chore updated readme --- README.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/README.md b/README.md index c1217e5d..c9611b1b 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,6 @@ Simple, fast, light and fun to develop with. Also easy, very easy to test ;) - [http://gomicro.services (Official site and Documentation)](http://gomicro.services) - [Database examples](https://moleculer-go-site.herokuapp.com/docs/0.1/store.html) -- [WhatsApp App](https://github.com/moleculer-go/example-whatsapp) -- [Benchmark](https://github.com/moleculer-go/benchmark) ## Example @@ -65,12 +63,8 @@ func main() { # Roadmap -![Timeline](https://moleculer-go-site.herokuapp.com/images/timeline.png) - ## v0.1.0 (MVP) -Development is `complete` - Documentation is `in-progress` and benchmark is also `in-progress`. - **Contents:** - Service Broker @@ -99,7 +93,7 @@ Development is `complete` - Documentation is `in-progress` and benchmark is also ## v0.3.0 (Beta) - Performance and Optimization -- More DB Adaptors (SQLLite, Firebase, MySQL) +- More DB Adaptors (Firebase, MySQL) - CLI for Project Seed Generation ## v0.4.0 (Alpha) From fd7efc2bebeee6a73fca60010b97986e5a3055b1 Mon Sep 17 00:00:00 2001 From: Rafael Date: Sun, 16 May 2021 17:57:45 +1200 Subject: [PATCH 2/8] chore fixed go.mod --- go.mod | 14 ++---- go.sum | 134 ++++++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 98 insertions(+), 50 deletions(-) diff --git a/go.mod b/go.mod index e0f34c59..e779cad5 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,10 @@ module github.com/moleculer-go/moleculer go 1.12 require ( - github.com/BurntSushi/toml v0.3.1 // indirect github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 // indirect - github.com/go-sql-driver/mysql v1.4.1 // indirect - github.com/go-stack/stack v1.8.0 // indirect github.com/gogo/protobuf v1.2.1 // indirect github.com/hashicorp/go-msgpack v0.5.5 // indirect github.com/hashicorp/raft v1.0.1 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/lib/pq v1.1.1 // indirect github.com/moleculer-go/cupaloy/v2 v2.5.2 github.com/moleculer-go/goemitter v1.0.3 @@ -22,19 +18,17 @@ require ( github.com/nats-io/nuid v1.0.1 // indirect github.com/onsi/ginkgo v1.16.2 github.com/onsi/gomega v1.10.1 - github.com/pkg/errors v0.8.1 + github.com/pkg/errors v0.9.1 github.com/prometheus/procfs v0.0.0-20190503130316-740c07785007 // indirect - github.com/sirupsen/logrus v1.4.1 + github.com/sirupsen/logrus v1.4.2 github.com/spf13/cobra v0.0.3 github.com/spf13/viper v1.3.2 github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271 github.com/tidwall/gjson v1.2.1 github.com/tidwall/match v1.0.1 // indirect - github.com/tidwall/pretty v0.0.0-20190325153808-1166b9ac2b65 // indirect + github.com/tidwall/pretty v1.1.0 // indirect github.com/tidwall/sjson v1.0.4 go.etcd.io/bbolt v1.3.2 // indirect - go.mongodb.org/mongo-driver v1.0.1 + go.mongodb.org/mongo-driver v1.5.2 golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6 // indirect - golang.org/x/tools v0.1.0 // indirect - google.golang.org/appengine v1.5.0 // indirect ) diff --git a/go.sum b/go.sum index 5b19eac5..412ef60d 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,7 @@ github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 h1:EFSB7Zo9Eg91v7MJPVsifUysc/wPdN+NOnVe6bWbdBM= github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg= +github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= @@ -13,30 +14,54 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee 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/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -51,18 +76,31 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/raft v1.0.1 h1:94uRdS11oEneUkxmXq6Vg9shNhBILh2UTb9crQjJWl0= github.com/hashicorp/raft v1.0.1/go.mod h1:DVSAWItjLjTOkVbSpWQ0j0kUADIvDaCtBxIcbNAQLkI= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= +github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -72,6 +110,7 @@ github.com/moleculer-go/goemitter v1.0.3 h1:/1adONxtR/ddscS+sEAO27E8bZ6Aq+1/USd7 github.com/moleculer-go/goemitter v1.0.3/go.mod h1:GgjB2n0fZ/M3aay0EdVbTNHllYj0RoXLAGy7w6RsZOE= github.com/moleculer-go/spew v1.2.0 h1:Ko5FrSdx9ssnYhjS6OMgMFtN6omV4ZfVccljU8Ccth0= github.com/moleculer-go/spew v1.2.0/go.mod h1:R1AWW56BWfDlXLJ6i5YB4uWzqhI1iiE6dU6MJ4w2iiE= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/nats-io/gnatsd v1.4.1 h1:RconcfDeWpKCD6QIIwiVFcvForlXpWeJP7i5/lDLy44= github.com/nats-io/gnatsd v1.4.1/go.mod h1:nqco77VO78hLCJpIcVfygDP2rPGfsEHkGTUk94uh5DQ= github.com/nats-io/go-nats v1.7.2 h1:cJujlwCYR8iMz5ofZSD/p2WLW8FabhkQ2lIEVbSvNSA= @@ -88,22 +127,21 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.2 h1:HFB2fbVIlhIfCfOW81bZFbiC/RvnpXSdhbF2/DJr134= github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= -github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.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/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= @@ -112,8 +150,13 @@ github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7q github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190503130316-740c07785007 h1:gT4PpkbWSQM4J8fup/aXeQhY5jLDyHuPq8y2dHspqFw= github.com/prometheus/procfs v0.0.0-20190503130316-740c07785007/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= @@ -130,99 +173,110 @@ github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271 h1:WhxRHzgeVGETMlmV github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 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/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tidwall/gjson v1.2.1 h1:j0efZLrZUvNerEf6xqoi0NjWMK5YlLrR7Guo/dxY174= github.com/tidwall/gjson v1.2.1/go.mod h1:c/nTNbUr0E0OrXEhq1pwa8iEgc2DOt4ZZqAt1HtCkPA= github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc= github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= -github.com/tidwall/pretty v0.0.0-20190325153808-1166b9ac2b65 h1:rQ229MBgvW68s1/g6f1/63TgYwYxfF4E+bi/KC19P8g= -github.com/tidwall/pretty v0.0.0-20190325153808-1166b9ac2b65/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tidwall/pretty v1.1.0 h1:K3hMW5epkdAVwibsQEfR/7Zj0Qgt4DxtNumTq/VloO8= +github.com/tidwall/pretty v1.1.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/sjson v1.0.4 h1:UcdIRXff12Lpnu3OLtZvnc03g4vH2suXDXhBwBqmzYg= github.com/tidwall/sjson v1.0.4/go.mod h1:bURseu1nuBkFpIES5cz6zBtjmYeOQmEESshn7VpF15Y= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.etcd.io/bbolt v1.3.2 h1:Z/90sZLPOeCy2PwprqkFa25PdkusRzaj9P8zm/KNyvk= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.mongodb.org/mongo-driver v1.0.1 h1:r2xNB8juGGrZVcIjX2TpY7HUfz+pNYq+GIuC9h6URZg= -go.mongodb.org/mongo-driver v1.0.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0= +go.mongodb.org/mongo-driver v1.5.2 h1:AsxOLoJTgP6YNM0fXWw4OjdluYmWzQYp+lFJL7xu9fU= +go.mongodb.org/mongo-driver v1.5.2/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc h1:a3CU5tJYVj92DY2LaA1kUkrsqD5/3mLDhx2NcNqyW+0= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a h1:1n5lsVfiQW3yfsRGu98756EH1YthsFqr/5mxHduZW2A= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6 h1:cdsMqa2nXzqlgs183pHxtvoVwU7CyzaCTAUOg94af4c= golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -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/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From cf0b82e095dac43359557223a8498a5e3b1a7167 Mon Sep 17 00:00:00 2001 From: Rafael Date: Sun, 16 May 2021 18:04:46 +1200 Subject: [PATCH 3/8] chore trying to fix drone build --- .drone.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.drone.yml b/.drone.yml index 49794325..535b9fbf 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,6 +28,8 @@ steps: - export STAN_HOST="nats-streaming" - export NATS_HOST="nats-streaming" - export AMQP_HOST="guest:guest@rabbitmq" + - go get github.com/onsi/ginkgo/ginkgo@v1.16.2 + - go get github.com/onsi/ginkgo/ginkgo/outline@v1.16.2 - go build - go run github.com/onsi/ginkgo/ginkgo -r --keepGoing --cover --trace -skipPackage=amqp # - curl -sL https://deb.nodesource.com/setup_12.x | bash - From d3f4348b211a9f47c63222abffdedadb5cc216a0 Mon Sep 17 00:00:00 2001 From: Rafael Date: Sun, 16 May 2021 18:09:11 +1200 Subject: [PATCH 4/8] chore trying to fix drone build --- .drone.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 535b9fbf..49794325 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,8 +28,6 @@ steps: - export STAN_HOST="nats-streaming" - export NATS_HOST="nats-streaming" - export AMQP_HOST="guest:guest@rabbitmq" - - go get github.com/onsi/ginkgo/ginkgo@v1.16.2 - - go get github.com/onsi/ginkgo/ginkgo/outline@v1.16.2 - go build - go run github.com/onsi/ginkgo/ginkgo -r --keepGoing --cover --trace -skipPackage=amqp # - curl -sL https://deb.nodesource.com/setup_12.x | bash - From fcd207143c72a323cbc04f07a466aa57cb1a69c7 Mon Sep 17 00:00:00 2001 From: Rafael Date: Sun, 16 May 2021 18:10:56 +1200 Subject: [PATCH 5/8] chore trying to fix drone build --- .drone.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.drone.yml b/.drone.yml index 49794325..535b9fbf 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,6 +28,8 @@ steps: - export STAN_HOST="nats-streaming" - export NATS_HOST="nats-streaming" - export AMQP_HOST="guest:guest@rabbitmq" + - go get github.com/onsi/ginkgo/ginkgo@v1.16.2 + - go get github.com/onsi/ginkgo/ginkgo/outline@v1.16.2 - go build - go run github.com/onsi/ginkgo/ginkgo -r --keepGoing --cover --trace -skipPackage=amqp # - curl -sL https://deb.nodesource.com/setup_12.x | bash - From 22d6db3c9e68bc854dc84e085856a18f5d80926c Mon Sep 17 00:00:00 2001 From: Rafael Date: Sun, 16 May 2021 20:35:44 +1200 Subject: [PATCH 6/8] feat (v4) added node info, and ping pong params --- broker/broker.go | 13 +++++++++++++ go.mod | 1 + go.sum | 3 ++- moleculer.go | 2 ++ ...b--func3-1-1-1-no-services-$node.listcpuBroker | 12 +++++++++--- ...unc3-1-1-1-no-services-$node.listprinterBroker | 4 +++- ...unc3-1-1-1-no-services-$node.listscannerBroker | 8 ++++++-- ...c3-1-1-1-with-services-$node.listprinterBroker | 4 +++- registry/node.go | 2 ++ transit/pubsub/pubsub.go | 15 +++++++++++++++ transit/pubsub/pubsub_test.go | 6 ++++++ 11 files changed, 62 insertions(+), 8 deletions(-) diff --git a/broker/broker.go b/broker/broker.go index c6f0b0b6..26d53aaf 100644 --- a/broker/broker.go +++ b/broker/broker.go @@ -5,6 +5,7 @@ import ( "strings" "time" + "github.com/hashicorp/go-uuid" bus "github.com/moleculer-go/goemitter" "github.com/moleculer-go/moleculer" "github.com/moleculer-go/moleculer/cache" @@ -115,6 +116,8 @@ type ServiceBroker struct { id string + instanceID string + localNode moleculer.Node } @@ -566,6 +569,13 @@ func (broker *ServiceBroker) init() { broker.config = broker.middlewares.CallHandlers("Config", broker.config).(moleculer.Config) + instanceID, err := uuid.GenerateUUID() + if err != nil { + broker.logger.Error("Could not create an instance id - error ", err) + instanceID = "error creating instance id" + } + broker.instanceID = instanceID + broker.delegates = broker.createDelegates() broker.registry = registry.CreateRegistry(broker.id, broker.delegates) broker.localNode = broker.registry.LocalNode() @@ -580,6 +590,9 @@ func (broker *ServiceBroker) createDelegates() *moleculer.BrokerDelegates { Bus: broker.LocalBus, IsStarted: broker.IsStarted, Config: broker.config, + InstanceID: func() string { + return broker.instanceID + }, ActionDelegate: func(context moleculer.BrokerContext, opts ...moleculer.Options) chan moleculer.Payload { return broker.registry.LoadBalanceCall(context, opts...) }, diff --git a/go.mod b/go.mod index e779cad5..dfbf211e 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 // indirect github.com/gogo/protobuf v1.2.1 // indirect github.com/hashicorp/go-msgpack v0.5.5 // indirect + github.com/hashicorp/go-uuid v1.0.2 // indirect github.com/hashicorp/raft v1.0.1 // indirect github.com/lib/pq v1.1.1 // indirect github.com/moleculer-go/cupaloy/v2 v2.5.2 diff --git a/go.sum b/go.sum index 412ef60d..71146b04 100644 --- a/go.sum +++ b/go.sum @@ -68,8 +68,9 @@ github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjh github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= diff --git a/moleculer.go b/moleculer.go index d9b98e8e..895edf82 100644 --- a/moleculer.go +++ b/moleculer.go @@ -203,6 +203,7 @@ type LoggerFunc func(name string, value string) *log.Entry type BusFunc func() *bus.Emitter type isStartedFunc func() bool type LocalNodeFunc func() Node +type InstanceIDFunc func() string type ActionDelegateFunc func(context BrokerContext, opts ...Options) chan Payload type EmitEventFunc func(context BrokerContext) type ServiceForActionFunc func(string) []*ServiceSchema @@ -280,6 +281,7 @@ type BrokerContext interface { //Needs Refactoring..2 broker interfaces.. one for regiwstry.. and for for all others. type BrokerDelegates struct { + InstanceID InstanceIDFunc LocalNode LocalNodeFunc Logger LoggerFunc Bus BusFunc diff --git a/registry/.snapshots/registry_test-glob--func3-1-1-1-no-services-$node.listcpuBroker b/registry/.snapshots/registry_test-glob--func3-1-1-1-no-services-$node.listcpuBroker index 2ce4f223..8104e041 100644 --- a/registry/.snapshots/registry_test-glob--func3-1-1-1-no-services-$node.listcpuBroker +++ b/registry/.snapshots/registry_test-glob--func3-1-1-1-no-services-$node.listcpuBroker @@ -1,5 +1,5 @@ (map[string]map[string]interface {}) (len=3) { - (string) (len=13) "nodeCpuBroker": (map[string]interface {}) (len=8) { + (string) (len=13) "nodeCpuBroker": (map[string]interface {}) (len=9) { (string) (len=2) "id": (string) (len=14) "node_cpuBroker", (string) (len=3) "cpu": (int64) 0, (string) (len=3) "seq": (string) (len=7) "removed", @@ -13,9 +13,11 @@ (string) (len=13) "100.100.0.100" }, (string) (len=8) "hostname": (string) (len=7) "removed", + (string) (len=8) "metadata": (map[string]interface {}) { + }, (string) (len=9) "available": (bool) true }, - (string) (len=17) "nodePrinterBroker": (map[string]interface {}) (len=8) { + (string) (len=17) "nodePrinterBroker": (map[string]interface {}) (len=9) { (string) (len=2) "id": (string) (len=18) "node_printerBroker", (string) (len=3) "cpu": (int64) 0, (string) (len=3) "seq": (string) (len=7) "removed", @@ -29,9 +31,11 @@ (string) (len=13) "100.100.0.100" }, (string) (len=8) "hostname": (string) (len=7) "removed", + (string) (len=8) "metadata": (map[string]interface {}) { + }, (string) (len=9) "available": (bool) true }, - (string) (len=17) "nodeScannerBroker": (map[string]interface {}) (len=8) { + (string) (len=17) "nodeScannerBroker": (map[string]interface {}) (len=9) { (string) (len=2) "id": (string) (len=18) "node_scannerBroker", (string) (len=3) "cpu": (int64) 0, (string) (len=3) "seq": (string) (len=7) "removed", @@ -45,6 +49,8 @@ (string) (len=13) "100.100.0.100" }, (string) (len=8) "hostname": (string) (len=7) "removed", + (string) (len=8) "metadata": (map[string]interface {}) { + }, (string) (len=9) "available": (bool) true } } diff --git a/registry/.snapshots/registry_test-glob--func3-1-1-1-no-services-$node.listprinterBroker b/registry/.snapshots/registry_test-glob--func3-1-1-1-no-services-$node.listprinterBroker index b1932c15..2d00ad71 100644 --- a/registry/.snapshots/registry_test-glob--func3-1-1-1-no-services-$node.listprinterBroker +++ b/registry/.snapshots/registry_test-glob--func3-1-1-1-no-services-$node.listprinterBroker @@ -1,6 +1,6 @@ (map[string]map[string]interface {}) (len=3) { (string) (len=13) "nodeCpuBroker": (map[string]interface {}) , - (string) (len=17) "nodePrinterBroker": (map[string]interface {}) (len=8) { + (string) (len=17) "nodePrinterBroker": (map[string]interface {}) (len=9) { (string) (len=2) "id": (string) (len=18) "node_printerBroker", (string) (len=3) "cpu": (int64) 0, (string) (len=3) "seq": (string) (len=7) "removed", @@ -14,6 +14,8 @@ (string) (len=13) "100.100.0.100" }, (string) (len=8) "hostname": (string) (len=7) "removed", + (string) (len=8) "metadata": (map[string]interface {}) { + }, (string) (len=9) "available": (bool) true }, (string) (len=17) "nodeScannerBroker": (map[string]interface {}) diff --git a/registry/.snapshots/registry_test-glob--func3-1-1-1-no-services-$node.listscannerBroker b/registry/.snapshots/registry_test-glob--func3-1-1-1-no-services-$node.listscannerBroker index 063780ca..72837a71 100644 --- a/registry/.snapshots/registry_test-glob--func3-1-1-1-no-services-$node.listscannerBroker +++ b/registry/.snapshots/registry_test-glob--func3-1-1-1-no-services-$node.listscannerBroker @@ -1,6 +1,6 @@ (map[string]map[string]interface {}) (len=3) { (string) (len=13) "nodeCpuBroker": (map[string]interface {}) , - (string) (len=17) "nodePrinterBroker": (map[string]interface {}) (len=8) { + (string) (len=17) "nodePrinterBroker": (map[string]interface {}) (len=9) { (string) (len=2) "id": (string) (len=18) "node_printerBroker", (string) (len=3) "cpu": (int64) 0, (string) (len=3) "seq": (string) (len=7) "removed", @@ -14,9 +14,11 @@ (string) (len=13) "100.100.0.100" }, (string) (len=8) "hostname": (string) (len=7) "removed", + (string) (len=8) "metadata": (map[string]interface {}) { + }, (string) (len=9) "available": (bool) true }, - (string) (len=17) "nodeScannerBroker": (map[string]interface {}) (len=8) { + (string) (len=17) "nodeScannerBroker": (map[string]interface {}) (len=9) { (string) (len=2) "id": (string) (len=18) "node_scannerBroker", (string) (len=3) "cpu": (int64) 0, (string) (len=3) "seq": (string) (len=7) "removed", @@ -30,6 +32,8 @@ (string) (len=13) "100.100.0.100" }, (string) (len=8) "hostname": (string) (len=7) "removed", + (string) (len=8) "metadata": (map[string]interface {}) { + }, (string) (len=9) "available": (bool) true } } diff --git a/registry/.snapshots/registry_test-glob--func3-1-1-1-with-services-$node.listprinterBroker b/registry/.snapshots/registry_test-glob--func3-1-1-1-with-services-$node.listprinterBroker index e04ff316..edb3502e 100644 --- a/registry/.snapshots/registry_test-glob--func3-1-1-1-with-services-$node.listprinterBroker +++ b/registry/.snapshots/registry_test-glob--func3-1-1-1-with-services-$node.listprinterBroker @@ -1,6 +1,6 @@ (map[string]map[string]interface {}) (len=3) { (string) (len=13) "nodeCpuBroker": (map[string]interface {}) , - (string) (len=17) "nodePrinterBroker": (map[string]interface {}) (len=9) { + (string) (len=17) "nodePrinterBroker": (map[string]interface {}) (len=10) { (string) (len=2) "id": (string) (len=18) "node_printerBroker", (string) (len=3) "cpu": (int64) 0, (string) (len=3) "seq": (string) (len=7) "removed", @@ -14,6 +14,8 @@ (string) (len=13) "100.100.0.100" }, (string) (len=8) "hostname": (string) (len=7) "removed", + (string) (len=8) "metadata": (map[string]interface {}) { + }, (string) (len=8) "services": ([]map[string]interface {}) (len=2) { (map[string]interface {}) (len=7) { (string) (len=4) "name": (string) (len=5) "$node", diff --git a/registry/node.go b/registry/node.go index 43b2d84b..8c93b287 100644 --- a/registry/node.go +++ b/registry/node.go @@ -154,6 +154,8 @@ func (node *Node) ExportAsMap() map[string]interface{} { resultMap["cpu"] = node.cpu resultMap["cpuSeq"] = node.cpuSequence resultMap["available"] = node.IsAvailable() + resultMap["metadata"] = make(map[string]interface{}) + return resultMap } diff --git a/transit/pubsub/pubsub.go b/transit/pubsub/pubsub.go index 944b2eda..3f82a63f 100644 --- a/transit/pubsub/pubsub.go +++ b/transit/pubsub/pubsub.go @@ -17,6 +17,7 @@ import ( "github.com/moleculer-go/moleculer/transit" "github.com/moleculer-go/moleculer/transit/memory" "github.com/moleculer-go/moleculer/transit/nats" + "github.com/moleculer-go/moleculer/util" "github.com/moleculer-go/moleculer" "github.com/moleculer-go/moleculer/serializer" @@ -526,12 +527,23 @@ func (pubsub *PubSub) neighbours() int64 { return int64(len(pubsub.knownNeighbours)) } +func configToMap(config moleculer.Config) map[string]string { + m := make(map[string]string) + m["logLevel"] = config.LogLevel + m["transporter"] = config.Transporter + m["namespace"] = config.Namespace + m["requestTimeout"] = config.RequestTimeout.String() + return m +} + // broadcastNodeInfo send the local node info to the target node, if empty to all nodes. func (pubsub *PubSub) broadcastNodeInfo(targetNodeID string) { payload := pubsub.broker.LocalNode().ExportAsMap() payload["sender"] = payload["id"] payload["neighbours"] = pubsub.neighbours() payload["ver"] = version.MoleculerProtocol() + payload["config"] = configToMap(pubsub.broker.Config) + payload["instanceID"] = pubsub.broker.InstanceID() message, _ := pubsub.serializer.MapToPayload(&payload) pubsub.transport.Publish("INFO", targetNodeID, message) @@ -563,6 +575,7 @@ func (pubsub *PubSub) SendPing() { ping["sender"] = sender ping["ver"] = version.MoleculerProtocol() ping["time"] = time.Now().Unix() + ping["id"] = util.RandomString(12) pingMessage, _ := pubsub.serializer.MapToPayload(&ping) pubsub.transport.Publish("PING", sender, pingMessage) @@ -576,6 +589,7 @@ func (pubsub *PubSub) pingHandler() transit.TransportHandler { pong["ver"] = version.MoleculerProtocol() pong["time"] = message.Get("time").Int() pong["arrived"] = time.Now().Unix() + pong["id"] = util.RandomString(12) pongMessage, _ := pubsub.serializer.MapToPayload(&pong) pubsub.transport.Publish("PONG", sender, pongMessage) @@ -594,6 +608,7 @@ func (pubsub *PubSub) pongHandler() transit.TransportHandler { mapValue["nodeID"] = message.Get("sender").String() mapValue["elapsedTime"] = elapsed mapValue["timeDiff"] = timeDiff + mapValue["id"] = message.Get("id").String() pubsub.broker.Bus().EmitAsync("$node.pong", []interface{}{mapValue}) } diff --git a/transit/pubsub/pubsub_test.go b/transit/pubsub/pubsub_test.go index b8427ba7..527983d9 100644 --- a/transit/pubsub/pubsub_test.go +++ b/transit/pubsub/pubsub_test.go @@ -39,6 +39,9 @@ var _ = Describe("PubSub Internals", func() { LocalNode: func() moleculer.Node { return &localNode }, + InstanceID: func() string { + return "instance-id" + }, }, transport: mockT, brokerStarted: true, @@ -77,6 +80,9 @@ var _ = Describe("PubSub Internals", func() { LocalNode: func() moleculer.Node { return &localNode }, + InstanceID: func() string { + return "instance-id" + }, }, transport: mockT, } From ca7481351aa5be7dffaa2ccb31f801df2f0b0ae9 Mon Sep 17 00:00:00 2001 From: Rafael Date: Sun, 13 Jun 2021 17:46:52 +1200 Subject: [PATCH 7/8] feat (v4 features) added v4 protocol payload features --- context/contextFactory.go | 47 +++++++++++++++++++++++----------- context/context_test.go | 49 ++++++++++++++++++++++++++++++------ metrics/metrics.go | 2 +- moleculer.go | 3 ++- registry/registry_test.go | 3 +++ serializer/jsonSerializer.go | 6 ++--- transit/nats/nats_test.go | 6 +++-- transit/pubsub/pubsub.go | 37 +++++++++++++++++++++++++++ 8 files changed, 123 insertions(+), 30 deletions(-) diff --git a/context/contextFactory.go b/context/contextFactory.go index 6ee06243..3a4572ad 100644 --- a/context/contextFactory.go +++ b/context/contextFactory.go @@ -26,6 +26,7 @@ type Context struct { meta moleculer.Payload timeout int level int + caller string } func BrokerContext(broker *moleculer.BrokerDelegates) moleculer.BrokerContext { @@ -46,7 +47,7 @@ func (context *Context) ChildEventContext(eventName string, params moleculer.Pay parentContext := context meta := parentContext.meta if context.broker.Config.Metrics { - meta = meta.Add("metrics", true) + meta = meta.Add("tracing", true) } id := util.RandomString(12) var requestID string @@ -55,6 +56,10 @@ func (context *Context) ChildEventContext(eventName string, params moleculer.Pay } else { requestID = id } + caller := parentContext.actionName + if parentContext.eventName != "" { + caller = parentContext.eventName + } eventContext := Context{ id: id, requestID: requestID, @@ -66,6 +71,7 @@ func (context *Context) ChildEventContext(eventName string, params moleculer.Pay level: parentContext.level + 1, meta: meta, parentID: parentContext.id, + caller: caller, } return &eventContext } @@ -80,7 +86,7 @@ func (context *Context) ChildActionContext(actionName string, params moleculer.P parentContext := context meta := parentContext.meta if context.broker.Config.Metrics { - meta = meta.Add("metrics", true) + meta = meta.Add("tracing", true) } if len(opts) > 0 && opts[0].Meta != nil && opts[0].Meta.Len() > 0 { meta = meta.AddMany(opts[0].Meta.RawMap()) @@ -92,6 +98,10 @@ func (context *Context) ChildActionContext(actionName string, params moleculer.P } else { requestID = id } + caller := parentContext.actionName + if parentContext.eventName != "" { + caller = parentContext.eventName + } actionContext := Context{ id: id, requestID: requestID, @@ -101,15 +111,11 @@ func (context *Context) ChildActionContext(actionName string, params moleculer.P level: parentContext.level + 1, meta: meta, parentID: parentContext.id, + caller: caller, } return &actionContext } -// Max calling level check to avoid calling loops -func checkMaxCalls(context *Context) { - -} - // ActionContext create an action context for remote call. func ActionContext(broker *moleculer.BrokerDelegates, values map[string]interface{}) moleculer.BrokerContext { var level int @@ -130,6 +136,10 @@ func ActionContext(broker *moleculer.BrokerDelegates, values map[string]interfac parentID = s } } + // params := payload.Empty() + // if values["params"] != nil { + // params = payload.New(values["params"]) + // } params := payload.New(values["params"]) if values["timeout"] != nil { @@ -210,20 +220,22 @@ func (context *Context) RequestID() string { func (context *Context) AsMap() map[string]interface{} { mapResult := make(map[string]interface{}) - var metrics bool - if context.meta.Get("metrics").Exists() { - metrics = context.meta.Get("metrics").Bool() + var tracing bool + if context.meta.Get("tracing").Exists() { + tracing = context.meta.Get("tracing").Bool() } mapResult["id"] = context.id mapResult["requestID"] = context.requestID mapResult["level"] = context.level + mapResult["meta"] = context.meta.RawMap() + mapResult["caller"] = context.caller + mapResult["tracing"] = tracing + mapResult["parentID"] = context.parentID + if context.actionName != "" { mapResult["action"] = context.actionName - mapResult["metrics"] = metrics - mapResult["parentID"] = context.parentID - mapResult["meta"] = context.meta.RawMap() mapResult["timeout"] = context.timeout mapResult["params"] = context.params.Value() } @@ -232,11 +244,12 @@ func (context *Context) AsMap() map[string]interface{} { mapResult["groups"] = context.groups mapResult["broadcast"] = context.broadcast mapResult["data"] = context.params.Value() - mapResult["meta"] = context.meta.RawMap() + mapResult["level"] = context.level } - //TODO : check how to support streaming params in go + //streaming not supported yet mapResult["stream"] = false + //mapResult["seq"] = 0 // for stream payloads return mapResult } @@ -323,3 +336,7 @@ func (context *Context) Logger() *log.Entry { } return context.broker.Logger("context", "") } + +func (context *Context) Caller() string { + return context.caller +} diff --git a/context/context_test.go b/context/context_test.go index e209dd28..69850da8 100644 --- a/context/context_test.go +++ b/context/context_test.go @@ -33,7 +33,7 @@ var _ = g.Describe("Context", func() { "meta": map[string]interface{}{}, }) Expect(actionContext).ShouldNot(BeNil()) - Expect(len(actionContext.AsMap())).Should(Equal(10)) + Expect(len(actionContext.AsMap())).Should(Equal(11)) Expect(actionContext.ActionName()).Should(Equal("action")) Expect(actionContext.Payload()).Should(Equal(payload.Empty())) Expect(actionContext.ID()).Should(Equal("id")) @@ -47,7 +47,26 @@ var _ = g.Describe("Context", func() { "parentID": "parentID", "params": map[string]interface{}{}, }) - }).Should(Panic()) + }).Should(Panic()) //no action + }) + + g.It("Should create an action context with no params", func() { + delegates := test.DelegatesWithIdAndConfig("x", moleculer.Config{}) + actionContext := ActionContext(delegates, map[string]interface{}{ + "sender": "test", + "id": "id", + "action": "action", + "level": 2, + "timeout": 20, + "parentID": "parentID", + "meta": map[string]interface{}{}, + }) + Expect(actionContext).ShouldNot(BeNil()) + Expect(len(actionContext.AsMap())).Should(Equal(11)) + Expect(actionContext.ActionName()).Should(Equal("action")) + Expect(actionContext.Payload()).Should(Equal(payload.New(nil))) + Expect(actionContext.ID()).Should(Equal("id")) + Expect(actionContext.Logger()).ShouldNot(BeNil()) }) g.It("Should call SetTargetNodeID", func() { @@ -81,7 +100,7 @@ var _ = g.Describe("Context", func() { }) Expect(eventContext).ShouldNot(BeNil()) Expect(eventContext.IsBroadcast()).Should(BeTrue()) - Expect(len(eventContext.AsMap())).Should(Equal(9)) + Expect(len(eventContext.AsMap())).Should(Equal(12)) Expect(eventContext.EventName()).Should(Equal("event")) Expect(eventContext.Groups()).Should(Equal([]string{"a", "b"})) Expect(eventContext.Payload()).Should(Equal(payload.Empty())) @@ -96,7 +115,7 @@ var _ = g.Describe("Context", func() { }).Should(Panic()) }) - g.It("Should create a child context with metrics on", func() { + g.It("Should create a child context with tracing on", func() { config := moleculer.Config{ Metrics: true, @@ -104,12 +123,12 @@ var _ = g.Describe("Context", func() { brokerContext := BrokerContext(test.DelegatesWithIdAndConfig("nodex", config)) actionContext := brokerContext.ChildActionContext("actionx", nil) Expect(actionContext.Meta()).ShouldNot(BeNil()) - Expect(actionContext.Meta().Get("metrics").Bool()).Should(BeTrue()) + Expect(actionContext.Meta().Get("tracing").Bool()).Should(BeTrue()) eventContext := brokerContext.ChildEventContext("eventx", nil, nil, false) Expect(eventContext.Meta()).ShouldNot(BeNil()) Expect(eventContext.RequestID()).ShouldNot(Equal("")) - Expect(actionContext.Meta().Get("metrics").Bool()).Should(BeTrue()) + Expect(actionContext.Meta().Get("tracing").Bool()).Should(BeTrue()) config = moleculer.Config{ Metrics: false, @@ -117,11 +136,11 @@ var _ = g.Describe("Context", func() { brokerContext = BrokerContext(test.DelegatesWithIdAndConfig("nodex", config)) actionContext = brokerContext.ChildActionContext("actionx", nil) Expect(actionContext.Meta()).ShouldNot(BeNil()) - Expect(actionContext.Meta().Get("metrics").Exists()).Should(BeFalse()) + Expect(actionContext.Meta().Get("tracing").Exists()).Should(BeFalse()) eventContext = brokerContext.ChildEventContext("eventx", nil, nil, false) Expect(eventContext.Meta()).ShouldNot(BeNil()) - Expect(actionContext.Meta().Get("metrics").Exists()).Should(BeFalse()) + Expect(actionContext.Meta().Get("tracing").Exists()).Should(BeFalse()) }) @@ -188,4 +207,18 @@ var _ = g.Describe("Context", func() { Expect(called).Should(BeTrue()) }) + g.It("Should create a child context with proper caller setting", func() { + + config := moleculer.Config{ + Metrics: true, + } + brokerContext := BrokerContext(test.DelegatesWithIdAndConfig("nodex", config)) + + actionAContext := brokerContext.ChildActionContext("servicex.action_a", nil) + + actionBContext := actionAContext.ChildActionContext("servicex.action_b", nil) + + Expect(actionBContext.Caller()).Should(Equal("servicex.action_a")) + }) + }) diff --git a/metrics/metrics.go b/metrics/metrics.go index 59c6c18c..ad8983db 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -64,7 +64,7 @@ func metricsPayload(brokerContext moleculer.BrokerContext) map[string]interface{ func createShouldMetric(Config moleculer.Config) func(context moleculer.BrokerContext) bool { var callsCount float32 = 0 return func(context moleculer.BrokerContext) bool { - if context.Meta().Get("metrics").Bool() { + if context.Meta().Get("tracing").Bool() { callsCount++ if callsCount*Config.MetricsRate >= 1.0 { diff --git a/moleculer.go b/moleculer.go index 895edf82..68d3fcfb 100644 --- a/moleculer.go +++ b/moleculer.go @@ -171,7 +171,7 @@ var DefaultConfig = Config{ RetryPolicy: RetryPolicy{ Enabled: false, }, - RequestTimeout: 1 * time.Minute, + RequestTimeout: 3 * time.Second, MCallTimeout: 5 * time.Second, WaitForNeighboursInterval: 200 * time.Millisecond, } @@ -262,6 +262,7 @@ type BrokerContext interface { Payload() Payload Groups() []string IsBroadcast() bool + Caller() string //export context info in a map[string] AsMap() map[string]interface{} diff --git a/registry/registry_test.go b/registry/registry_test.go index 36828acb..0de31e5f 100644 --- a/registry/registry_test.go +++ b/registry/registry_test.go @@ -277,6 +277,7 @@ var _ = Describe("Registry", func() { transport := memory.Create(log.WithField("transport", "memory"), mem) return &transport }, + RequestTimeout: 1 * time.Second, }) stageBroker := broker.New(&moleculer.Config{ @@ -287,6 +288,7 @@ var _ = Describe("Registry", func() { transport := memory.Create(log.WithField("transport", "memory"), mem) return &transport }, + RequestTimeout: 1 * time.Second, }) stage2Broker := broker.New(&moleculer.Config{ @@ -297,6 +299,7 @@ var _ = Describe("Registry", func() { transport := memory.Create(log.WithField("transport", "memory"), mem) return &transport }, + RequestTimeout: 1 * time.Second, }) //alarm service - prints the alarm and return the namespace :) diff --git a/serializer/jsonSerializer.go b/serializer/jsonSerializer.go index c0d3cd61..6b197283 100644 --- a/serializer/jsonSerializer.go +++ b/serializer/jsonSerializer.go @@ -31,8 +31,8 @@ func CreateJSONSerializer(logger *log.Entry) JSONSerializer { return JSONSerializer{logger} } -// mapToContext make sure all value types are compatible with the context fields. -func (serializer JSONSerializer) contextMap(values map[string]interface{}) map[string]interface{} { +// cleanContextMap make sure all value types are compatible with the context fields. +func (serializer JSONSerializer) cleanContextMap(values map[string]interface{}) map[string]interface{} { if values["level"] != nil { values["level"] = int(values["level"].(float64)) } @@ -249,7 +249,7 @@ func (serializer JSONSerializer) MapToPayload(mapValue *map[string]interface{}) } func (serializer JSONSerializer) PayloadToContextMap(message moleculer.Payload) map[string]interface{} { - return serializer.contextMap(message.RawMap()) + return serializer.cleanContextMap(message.RawMap()) } func (jp JSONPayload) Get(path string, defaultValue ...interface{}) moleculer.Payload { diff --git a/transit/nats/nats_test.go b/transit/nats/nats_test.go index cfc6424b..6576e22d 100644 --- a/transit/nats/nats_test.go +++ b/transit/nats/nats_test.go @@ -89,14 +89,16 @@ var _ = Describe("NATS Streaming Transit", func() { p := (<-profileBroker.Call("user.update", longList)) Expect(p.Error()).Should(Succeed()) userBroker.Stop() - Expect((<-profileBroker.Call("user.update", longList)).IsError()).Should(BeTrue()) + + r := <-profileBroker.Call("user.update", longList) + Expect(r.IsError()).Should(BeTrue()) profileBroker.Stop() }) }) Describe("Start / Stop Cycles.", func() { - logLevel := "fatal" + logLevel := "error" numberOfLoops := 5 loopNumber := 0 Measure("Creation of multiple brokers with connect/disconnect cycles running on nats transporter.", func(bench Benchmarker) { diff --git a/transit/pubsub/pubsub.go b/transit/pubsub/pubsub.go index 3f82a63f..4867e9b3 100644 --- a/transit/pubsub/pubsub.go +++ b/transit/pubsub/pubsub.go @@ -40,6 +40,11 @@ type PubSub struct { brokerStarted bool } +const DATATYPE_UNDEFINED = 0 +const DATATYPE_NULL = 1 +const DATATYPE_JSON = 2 +const DATATYPE_BUFFER = 3 + func (pubsub *PubSub) onServiceAdded(values ...interface{}) { if pubsub.isConnected && pubsub.brokerStarted { localNodeID := pubsub.broker.LocalNode().GetID() @@ -303,6 +308,11 @@ func (pubsub *PubSub) Emit(context moleculer.BrokerContext) { payload := context.AsMap() payload["sender"] = pubsub.broker.LocalNode().GetID() payload["ver"] = version.MoleculerProtocol() + if context.Payload().Exists() { + payload["dataType"] = DATATYPE_JSON + } else { + payload["dataType"] = DATATYPE_NULL + } pubsub.logger.Trace("Emit() targetNodeID: ", targetNodeID, " payload: ", payload) @@ -323,6 +333,11 @@ func (pubsub *PubSub) Request(context moleculer.BrokerContext) chan moleculer.Pa payload := context.AsMap() payload["sender"] = pubsub.broker.LocalNode().GetID() payload["ver"] = version.MoleculerProtocol() + if context.Payload().Exists() { + payload["paramsType"] = DATATYPE_JSON + } else { + payload["paramsType"] = DATATYPE_NULL + } pubsub.logger.Trace("Request() targetNodeID: ", targetNodeID, " payload: ", payload) @@ -446,6 +461,12 @@ func (pubsub *PubSub) sendResponse(context moleculer.BrokerContext, response mol values["id"] = context.ID() values["meta"] = context.Meta() + if response.Exists() { + values["dataType"] = DATATYPE_JSON + } else { + values["dataType"] = DATATYPE_NULL + } + if response.IsError() { var errMap map[string]string actionError, isActionError := response.Value().(ActionError) @@ -484,12 +505,28 @@ type ActionError interface { Stack() string } +func parseParamsType(value moleculer.Payload) string { + if !value.Exists() { + return "1" //default : null + } + return value.String() +} + // requestHandler : handles when a request arrives on this node. // 1: create a moleculer.Context from the message, the moleculer.Context contains the target action // 2: invoke the action // 3: send a response func (pubsub *PubSub) requestHandler() transit.TransportHandler { return func(message moleculer.Payload) { + paramsType := parseParamsType(message.Get("paramsType")) + if paramsType != "1" && paramsType != "2" { + errMsg := "Expecting paramsType == 2 (JSON) or 1 (Null) - received: " + paramsType + pubsub.logger.Error(errMsg) + //currently there is only one serializer implementation. + //once more serializers are added, pubsub.serializer must change and be dinamic based on paramsType + pubsub.sendResponse(context.ActionContext(pubsub.broker, nil), payload.Error(errMsg)) + return + } values := pubsub.serializer.PayloadToContextMap(message) context := context.ActionContext(pubsub.broker, values) result := <-pubsub.broker.ActionDelegate(context) From 3ae858fa62d928c28f2f0ef1008fe43353ed2cec Mon Sep 17 00:00:00 2001 From: Rafael Date: Sun, 13 Jun 2021 17:58:57 +1200 Subject: [PATCH 8/8] chore updated protocol version --- version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/version.go b/version/version.go index 5fab0a2c..49915430 100644 --- a/version/version.go +++ b/version/version.go @@ -6,7 +6,7 @@ func Moleculer() string { } func MoleculerProtocol() string { - return "3" + return "4" } func Go() string {