diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 975a2a7520a7d17cac1a60e2544af1720cf10e44..a20fb8d48bb5e65e8ec1113c60dcb12e8f0393b5 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -54,13 +54,24 @@ jobs: go get -v -t -d ./... fi + - name: gofmt + run: | + go fmt ./... && git checkout -- go.mod && git status && [[ -z `git status -s` ]] + # diff -u <(echo -n) <(gofmt -d -s .) + + - name: Install go ci lint + run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.27.0 + + - name: Run Linter + run: golangci-lint run --timeout=10m -v + - name: Verify run: | make verify - name: Integrate Test run: | - chmod +x integrate_test.sh && ./integrate_test.sh + chmod +x integrate_test.sh && ./integrate_test.sh ${{github.event.pull_request.head.repo.full_name}} ${{github.event.pull_request.head.sha}} - name: Post Coverage run: bash <(curl -s https://codecov.io/bash) @@ -68,43 +79,3 @@ jobs: - name: Hello world run: echo Hello world ${{ secrets.DING_TOKEN }} ${{ secrets.DING_SIGN }} - # Because the contexts of push and PR are different, there are two Notify. - # Notifications are triggered only in the dubbogo/gost repository. - - name: DingTalk Message Notify only Push - uses: zcong1993/actions-ding@v3.0.1 - # Whether job is successful or not, always () is always true. - if: | - always() && - github.event_name == 'push' && - github.repository == 'apache/dubbo-go' - with: - # DingDing bot token - dingToken: ${{ env.DING_TOKEN }} - secret: ${{ env.DING_SIGN }} - # Post Body to send - body: | - { - "msgtype": "markdown", - "markdown": { - "title": "Github Actions", - "text": "## Github Actions \n - name: CI \n - repository: ${{ github.repository }} \n - trigger: ${{ github.actor }} \n - event: ${{ github.event_name }} \n - ref: ${{ github.ref }} \n - status: [${{ job.status }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) \n - environment: ${{ runner.os }} \n > SHA: [${{ github.sha }}](${{ github.event.compare }})" - } - } - - - name: DingTalk Message Notify only PR - uses: zcong1993/actions-ding@v3.0.1 - if: | - always() && - github.event_name == 'pull_request' && - github.repository == 'dubbogo/gost' - with: - dingToken: ${{ env.DING_TOKEN }} - secret: ${{ env.DING_SIGN }} - body: | - { - "msgtype": "markdown", - "markdown": { - "title": "Github Actions", - "text": "## Github Actions \n - name: CI \n - repository: ${{ github.repository }} \n - pr_title: **${{ github.event.pull_request.title }}** \n - trigger: ${{ github.actor }} \n - event: ${{ github.event_name }} \n - ref: [${{ github.ref }}](${{ github.event.pull_request._links.html.href }}) \n - status: [${{ job.status }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) \n - environment: ${{ runner.os }} \n > SHA: [${{ github.sha }}](${{ github.event.pull_request._links.html.href }})" - } - } diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000000000000000000000000000000000000..6f214f445ac5544b26d4fa704b7ea4524535f8bd --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,63 @@ +linters-settings: + govet: + check-shadowing: true + golint: + min-confidence: 0 + gocyclo: + min-complexity: 10 + maligned: + suggest-new: true + dupl: + threshold: 100 + goconst: + min-len: 2 + min-occurrences: 2 + depguard: + list-type: blacklist + packages: + # logging is allowed only by logutils.Log, logrus + # is allowed to use only in logutils package + - github.com/sirupsen/logrus + misspell: + locale: US + lll: + line-length: 140 + goimports: + local-prefixes: github.com/golangci/golangci-lint + gocritic: + enabled-tags: + - performance + - style + - experimental + disabled-checks: + - wrapperFunc + +linters: + disable-all: true + enable: + - govet + - staticcheck + - ineffassign + - misspell + +run: + skip-dirs: + - test/testdata_etc + - pkg/golinters/goanalysis/(checker|passes) + +issues: + exclude-rules: + - text: "weak cryptographic primitive" + linters: + - gosec + - linters: + - staticcheck + text: "SA1019:" + +# golangci.com configuration +# https://github.com/golangci/golangci/wiki/Configuration +service: + golangci-lint-version: 1.15.x # use the fixed version to not introduce new linters unexpectedly + prepare: + - echo "here I can run custom commands, but no preparation needed for this repo" + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4f79ecf3bc1439e00c88c4d0de74cc7a4bf26909..0000000000000000000000000000000000000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -dist: trusty -sudo: required - -# define the dependence env -language: go -os: - - linux -go: - - "1.13" -services: - - docker -env: - - GO111MODULE=on -install: true - -# define ci-stage -script: - - go fmt ./... && [[ -z `git status -s` ]] - # license-check - - make verify - # integrate-test - - chmod +x integrate_test.sh && ./integrate_test.sh - -after_success: - - bash <(curl -s https://codecov.io/bash) - -notifications: - webhooks: https://oapi.dingtalk.com/robot/send?access_token=f5d6237f2c79db584e75604f7f88db1ce1673c8c0e98451217b28fde791e1d4f diff --git a/NOTICE b/NOTICE index 1120c200c997fe6befbe3f78d95e9bdb8a05a487..e0f4af68f6ce22fb817ba1173663395ee8f2bfd9 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Apache Dubbo-go -Copyright 2018-2020 The Apache Software Foundation +Copyright 2018-2021 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). diff --git a/README.md b/README.md index f950a4b3e9c4e115eda2f0e99379286c4c66d24f..c77a0b47665db4d82064714426995834e6a778d0 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@  --- + Apache Dubbo Go Implementation. @@ -16,14 +17,14 @@ Apache License, Version 2.0 ## Release note ## +[v1.5.5 - Jan 5, 2021](https://github.com/apache/dubbo-go/releases/tag/v1.5.5) + [v1.4.5 - Nov 18, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.4.5) [v1.5.4 - Nov 1, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.5.4) [v1.5.3 - Sep 23, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.5.3) -[v1.5.2 - discard]() - [v1.5.1 - Aug 23, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.5.1) [v1.5.0 - July 24, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.5.0) @@ -134,25 +135,17 @@ Finished List: * [Zookeeper](https://github.com/apache/dubbo-go/blob/9a5990d9a9c3d5e6633c0d7d926c156416bcb931/registry/zookeeper/service_discovery.go) * [Etcd](https://github.com/apache/dubbo-go/blob/9a5990d9a9c3d5e6633c0d7d926c156416bcb931/registry/etcdv3/service_discovery.go) -- Others: - * start check - * connecting certain provider - * multi-protocols - * multi-registries - * multi-versions - * service group - You can know more about dubbo-go by its [roadmap](https://github.com/apache/dubbo-go/wiki/Roadmap).  ## Document -https://dubbogo.github.io/dubbo-go-website (**Improving**) +[dubbo-doc](http://dubbo.apache.org/zh/blog/) or [dubbo-go-doc-list](http://alexstocks.github.io/html/dubbogo.html) ## Quick Start -[dubbo-go-samples](https://github.com/apache/dubbo-go-samples) shows how to use dubbo-go. Please read the [dubbo-samples/golang/README.md](https://github.com/apache/dubbo-go-samples/blob/master/README.md) carefully to learn how to dispose the configuration and compile the program. +[dubbo-go-samples](https://github.com/apache/dubbo-go-samples) gives many examples to tell u how to use dubbo-go. Please read the [dubbo-samples/golang/README.md](https://github.com/apache/dubbo-go-samples/blob/master/README.md) carefully to learn how to dispose the configuration and compile the program. ## Running unit tests @@ -182,6 +175,17 @@ Please move to [dubbo-samples/golang](https://github.com/dubbogo/dubbo-samples) If you are willing to do some code contributions and document contributions to [Apache/dubbo-go](https://github.com/apache/dubbo-go), please visit [contribution intro](https://github.com/apache/dubbo-go/blob/master/contributing.md). +## Community + +If u want to communicate with our community, pls scan the following [dubbobo Ding-Ding QR code](https://mmbiz.qpic.cn/mmbiz_jpg/yvBJb5IiafvnHVBdtia30dxA2hKotr9DEckWsZ7aOJcDWDaSVMGwLmYv8GRgIQtqb4C2svicp8nVkMmGy7yKC5tyA/640?wx_fmt=jpeg&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1) or search our commnity DingDing group code 31363295. + +<a href="http://alexstocks.github.io/html/dubbogo.html"> +<img src="./doc/pic/misc/dubbogo-dingding.png" height="80" width="80"></a> + +If u want to visit the wechat group, pls add my wechat AlexanderStocks. + +We welcome the friends who can give us constructing suggestions instead of known-nothing. + ## Benchmark Benchmark project [dubbo-go-benchmark](https://github.com/dubbogo/dubbo-go-benchmark). @@ -259,8 +263,13 @@ If you are using [apache/dubbo-go](github.com/apache/dubbo-go) and think that it <img width="222px" src="https://ugc.hitv.com/platform_oss/F6077F1AA82542CDBDD88FD518E6E727.png"> </a> </td> + <td align="center" valign="middle"> + <a href="http://www.dmall.com" target="_blank"> + <img width="222px" src="https://mosn.io/images/community/duodian.png"> + </a> + </td> </tr> - <tr></tr> + <tr></tr> </tbody> </table> </div> diff --git a/README_CN.md b/README_CN.md index ff72428d977f8b24c7c60b228108987c823c9efa..bc3b54bf4c9198a74f7a4bd5d2a5c038f408aae0 100644 --- a/README_CN.md +++ b/README_CN.md @@ -15,14 +15,14 @@ Apache License, Version 2.0 ## 鍙戝竷鏃ュ織 ## +[v1.5.5 - 2021骞�1鏈�5鏃(https://github.com/apache/dubbo-go/releases/tag/v1.5.5) + [v1.4.5 - 2020骞�11鏈�18鏃(https://github.com/apache/dubbo-go/releases/tag/v1.4.5) [v1.5.4 - 2020骞�11鏈�1鏃(https://github.com/apache/dubbo-go/releases/tag/v1.5.4) [v1.5.3 - 2020骞�9鏈�23鏃(https://github.com/apache/dubbo-go/releases/tag/v1.5.3) -[v1.5.2 - 鑸嶅純]() - [v1.5.1 - 2020骞�8鏈�23鏃(https://github.com/apache/dubbo-go/releases/tag/v1.5.1) [v1.5.0 - 2020骞�7鏈�24鏃(https://github.com/apache/dubbo-go/releases/tag/v1.5.0) @@ -67,11 +67,11 @@ Apache License, Version 2.0 * Jsonrpc2.0 * [gRPC](https://github.com/apache/dubbo-go/pull/311) * [RESTful](https://github.com/apache/dubbo-go/pull/352) - + - 璺敱鍣� * [Condition router](https://github.com/apache/dubbo-go/pull/294) * [Health check router](https://github.com/apache/dubbo-go/pull/389) - + - 娉ㄥ唽涓績 * ZooKeeper * [etcd v3](https://github.com/apache/dubbo-go/pull/148) @@ -112,7 +112,7 @@ Apache License, Version 2.0 - 璋冪敤 * [娉涘寲璋冪敤](https://github.com/apache/dubbo-go/pull/122) - + - 鐩戞帶 * Opentracing API * [Prometheus](https://github.com/apache/dubbo-go/pull/342) @@ -133,25 +133,17 @@ Apache License, Version 2.0 * [Zookeeper](https://github.com/apache/dubbo-go/blob/9a5990d9a9c3d5e6633c0d7d926c156416bcb931/registry/zookeeper/service_discovery.go) * [Etcd](https://github.com/apache/dubbo-go/blob/9a5990d9a9c3d5e6633c0d7d926c156416bcb931/registry/etcdv3/service_discovery.go) -- 鍏朵粬鍔熻兘鏀寔: - * 鍚姩鏃舵鏌� - * 鏈嶅姟鐩磋繛 - * 澶氭湇鍔″崗璁� - * 澶氭敞鍐屼腑蹇� - * 澶氭湇鍔$増鏈� - * 鏈嶅姟鍒嗙粍 - 浣犲彲浠ラ€氳繃璁块棶 [roadmap](https://github.com/apache/dubbo-go/wiki/Roadmap) 鐭ラ亾鏇村鍏充簬 dubbo-go 鐨勪俊鎭€�  ## 鏂囨。 -https://dubbogo.github.io/dubbo-go-website (**瀹屽杽涓�**) +璇疯闂� [dubbo瀹樻柟鏂囨。涓叧浜� dubbo-go 鐨勭郴鍒楁枃妗(http://dubbo.apache.org/zh/blog/) 鎴� [杩囧線dubbo-go鏂囨。鍒楄〃](http://alexstocks.github.io/html/dubbogo.html)銆� ## 蹇€熷紑濮� ## -[dubbo-samples/golang](https://github.com/dubbogo/dubbo-samples)杩欎釜椤圭洰鐨勪簨渚嬪睍绀轰簡濡備綍浣跨敤 dubbo-go 銆傝浠旂粏闃呰 [dubbo-samples/golang/README.md](https://github.com/dubbogo/dubbo-samples/blob/master/golang/README.md) 瀛︿範濡備綍澶勭悊閰嶇疆骞剁紪璇戠▼搴忋€� +[dubbo-samples/golang](https://github.com/apache/dubbo-go-samples)杩欎釜椤圭洰鐨勪簨渚嬪睍绀轰簡濡備綍浣跨敤 dubbo-go 銆傝浠旂粏闃呰 [dubbo-samples/golang/README.md](https://github.com/apache/dubbo-go-samples/blob/master/README.md) 瀛︿範濡備綍澶勭悊閰嶇疆骞剁紪璇戠▼搴忋€� ## 杩愯鍗曟祴 @@ -181,6 +173,17 @@ make test 濡傛灉鎮ㄦ効鎰忕粰 [Apache/dubbo-go](https://github.com/apache/dubbo-go) 璐$尞浠g爜鎴栬€呮枃妗o紝鎴戜滑閮界儹鐑堟杩庛€傚叿浣撹鍙傝€� [contribution intro](https://github.com/apache/dubbo-go/blob/master/contributing.md)銆� +## 绀惧尯 + +濡傛灉鎯宠闂畼鏂归拤閽夌兢锛岃鍦ㄩ拤閽変腑鎼滅储绀惧尯缇ゅ彿 31363295 鎴栬€� 鎵弿濡備笅[浜岀淮鐮乚(https://mmbiz.qpic.cn/mmbiz_jpg/yvBJb5IiafvnHVBdtia30dxA2hKotr9DEckWsZ7aOJcDWDaSVMGwLmYv8GRgIQtqb4C2svicp8nVkMmGy7yKC5tyA/640?wx_fmt=jpeg&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1)銆� + +<a href="http://alexstocks.github.io/html/dubbogo.html"> +<img src="./doc/pic/misc/dubbogo-dingding.png" height="80" width="80"></a> + +濡傛灉鎯冲姞鍏ュ埌绀惧尯寰俊缇わ紝鍙互鍏堟坊鍔犵ぞ鍖鸿礋璐d汉 浜庨洦 鐨勫井淇� AlexanderStocks 銆� + +浣滀负涓€涓淮鎶ゅ凡缁忓府鍔╂瀯寤轰簡缁忓彈澶氬澶у瀷寰湇鍔$郴缁熺殑绀惧尯锛屾垜浠冻浠ヤ负鐜版湁鐨勬垚缁╂劅鍒拌嚜璞€傜ぞ鍖烘杩庤兘鎻愬嚭寤鸿鎬ф剰瑙佽€呫€� + ## 鎬ц兘娴嬭瘯 ## 鎬ц兘娴嬭瘯椤圭洰鏄� [dubbo-go-benchmark](https://github.com/dubbogo/dubbo-go-benchmark)銆� @@ -256,9 +259,14 @@ make test <a href="http://www.mgtv.com" target="_blank"> <img width="222px" src="https://ugc.hitv.com/platform_oss/F6077F1AA82542CDBDD88FD518E6E727.png"> </a> + </td> + <td align="center" valign="middle"> + <a href="http://www.dmall.com" target="_blank"> + <img width="222px" src="https://mosn.io/images/community/duodian.png"> + </a> </td> </tr> - <tr></tr> + <tr></tr> </tbody> </table> -</div> \ No newline at end of file +</div> diff --git a/cluster/cluster_impl/failback_cluster_invoker.go b/cluster/cluster_impl/failback_cluster_invoker.go index 62f48045ec6edbc19d6603509fa1ae8c2d4ce9ee..5e0d133a670160df4acf321ea05356cb2a45a8b5 100644 --- a/cluster/cluster_impl/failback_cluster_invoker.go +++ b/cluster/cluster_impl/failback_cluster_invoker.go @@ -77,8 +77,7 @@ func (invoker *failbackClusterInvoker) tryTimerTaskProc(ctx context.Context, ret invoked = append(invoked, retryTask.lastInvoker) retryInvoker := invoker.doSelect(retryTask.loadbalance, retryTask.invocation, retryTask.invokers, invoked) - var result protocol.Result - result = retryInvoker.Invoke(ctx, retryTask.invocation) + result := retryInvoker.Invoke(ctx, retryTask.invocation) if result.Error() != nil { retryTask.lastInvoker = retryInvoker invoker.checkRetry(retryTask, result.Error()) @@ -121,8 +120,11 @@ func (invoker *failbackClusterInvoker) checkRetry(retryTask *retryTimerTask, err if retryTask.retries > invoker.maxRetries { logger.Errorf("Failed retry times exceed threshold (%v), We have to abandon, invocation-> %v.\n", retryTask.retries, retryTask.invocation) - } else { - invoker.taskList.Put(retryTask) + return + } + + if err := invoker.taskList.Put(retryTask); err != nil { + logger.Errorf("invoker.taskList.Put(retryTask:%#v) = error:%v", retryTask, err) } } diff --git a/cluster/loadbalance/random_test.go b/cluster/loadbalance/random_test.go index b94d7da43d5bd42e6798fca750c8616830a8df8f..c24fdf0556b1323ccfc08a2f9f384c60e2fa2f5e 100644 --- a/cluster/loadbalance/random_test.go +++ b/cluster/loadbalance/random_test.go @@ -83,6 +83,7 @@ func TestRandomlbSelectWeight(t *testing.T) { } selectedInvoker = append(selectedInvoker, s) } + assert.Equal(t, 10000, len(selectedInvoker)) assert.Condition(t, func() bool { // really is 0.9999999999999 @@ -114,6 +115,8 @@ func TestRandomlbSelectWarmup(t *testing.T) { } selectedInvoker = append(selectedInvoker, s) } + assert.Equal(t, 10000, len(selectedInvoker)) + assert.Condition(t, func() bool { return selected/10000 < 0.1 }) diff --git a/cluster/router/chain/chain.go b/cluster/router/chain/chain.go index f55cd07bc9b360d3d79a7004bcc46ee8e8bc0d89..fccce838bb3f6750b72b83c4991ad78e8b49f138 100644 --- a/cluster/router/chain/chain.go +++ b/cluster/router/chain/chain.go @@ -195,7 +195,7 @@ func (c *RouterChain) copyInvokerIfNecessary(cache *InvokerCache) []protocol.Inv func (c *RouterChain) buildCache() { origin := c.loadCache() invokers := c.copyInvokerIfNecessary(origin) - if invokers == nil || len(invokers) == 0 { + if len(invokers) == 0 { return } @@ -296,8 +296,10 @@ func isInvokersChanged(left []protocol.Invoker, right []protocol.Invoker) bool { for _, r := range right { found := false + rurl := r.GetUrl() for _, l := range left { - if common.IsEquals(l.GetUrl(), r.GetUrl(), constant.TIMESTAMP_KEY, constant.REMOTE_TIMESTAMP_KEY) { + lurl := l.GetUrl() + if common.GetCompareURLEqualFunc()(lurl, rurl, constant.TIMESTAMP_KEY, constant.REMOTE_TIMESTAMP_KEY) { found = true break } diff --git a/cluster/router/chain/chain_test.go b/cluster/router/chain/chain_test.go index b21990b08c5b960c407a395cddf7ef7518ba5822..1bb7124a4f877a0ca65a3a683da97a44168e0275 100644 --- a/cluster/router/chain/chain_test.go +++ b/cluster/router/chain/chain_test.go @@ -76,8 +76,10 @@ conditions: _, err = z.Conn.Set(path, []byte(testyml), 0) assert.NoError(t, err) - defer ts.Stop() - defer z.Close() + defer func() { + _ = ts.Stop() + z.Close() + }() zkUrl, _ := common.NewURL(fmt.Sprintf(zkFormat, localIP, ts.Servers[0].Port)) configuration, err := extension.GetConfigCenterFactory(zk).GetDynamicConfiguration(zkUrl) @@ -128,11 +130,15 @@ conditions: _, err = z.Conn.Set(path, []byte(testyml), 0) assert.NoError(t, err) - defer ts.Stop() - defer z.Close() + defer func() { + _ = ts.Stop() + assert.NoError(t, err) + z.Close() + }() zkUrl, _ := common.NewURL(fmt.Sprintf(zkFormat, localIP, ts.Servers[0].Port)) configuration, err := extension.GetConfigCenterFactory(zk).GetDynamicConfiguration(zkUrl) + assert.NoError(t, err) config.GetEnvInstance().SetDynamicConfiguration(configuration) chain, err := NewRouterChain(getConditionRouteUrl(applicationKey)) @@ -154,11 +160,15 @@ conditions: func TestRouterChainRoute(t *testing.T) { ts, z, _, err := zookeeper.NewMockZookeeperClient("test", 15*time.Second) - defer ts.Stop() - defer z.Close() + defer func() { + err = ts.Stop() + assert.NoError(t, err) + z.Close() + }() zkUrl, _ := common.NewURL(fmt.Sprintf(zkFormat, localIP, ts.Servers[0].Port)) configuration, err := extension.GetConfigCenterFactory(zk).GetDynamicConfiguration(zkUrl) + assert.NoError(t, err) config.GetEnvInstance().SetDynamicConfiguration(configuration) chain, err := NewRouterChain(getConditionRouteUrl(applicationKey)) @@ -198,11 +208,15 @@ conditions: _, err = z.Conn.Set(path, []byte(testyml), 0) assert.NoError(t, err) - defer ts.Stop() - defer z.Close() + defer func() { + _ = ts.Stop() + assert.NoError(t, err) + z.Close() + }() zkUrl, _ := common.NewURL(fmt.Sprintf(zkFormat, localIP, ts.Servers[0].Port)) configuration, err := extension.GetConfigCenterFactory(zk).GetDynamicConfiguration(zkUrl) + assert.NoError(t, err) config.GetEnvInstance().SetDynamicConfiguration(configuration) chain, err := NewRouterChain(getConditionRouteUrl(applicationKey)) @@ -224,12 +238,17 @@ conditions: func TestRouterChainRouteNoRoute(t *testing.T) { ts, z, _, err := zookeeper.NewMockZookeeperClient("test", 15*time.Second) - defer ts.Stop() - defer z.Close() + assert.Nil(t, err) + defer func() { + _ = ts.Stop() + assert.NoError(t, err) + z.Close() + }() zkUrl, _ := common.NewURL(fmt.Sprintf(zkFormat, localIP, ts.Servers[0].Port)) configuration, err := extension.GetConfigCenterFactory(zk).GetDynamicConfiguration(zkUrl) config.GetEnvInstance().SetDynamicConfiguration(configuration) + assert.Nil(t, err) chain, err := NewRouterChain(getConditionNoRouteUrl(applicationKey)) assert.Nil(t, err) diff --git a/cluster/router/condition/app_router_test.go b/cluster/router/condition/app_router_test.go index 879abc5cc8b607ee9245ce632800b056ff740cc5..c8bc43eb33f9cbbb8bbc5c0b87a57907ac15aa62 100644 --- a/cluster/router/condition/app_router_test.go +++ b/cluster/router/condition/app_router_test.go @@ -67,8 +67,11 @@ conditions: _, err = z.Conn.Set(routerPath, []byte(testYML), 0) assert.NoError(t, err) - defer ts.Stop() - defer z.Close() + defer func() { + err = ts.Stop() + assert.NoError(t, err) + z.Close() + }() zkUrl, _ := common.NewURL(fmt.Sprintf(zkFormat, routerLocalIP, ts.Servers[0].Port)) configuration, err := extension.GetConfigCenterFactory(routerZk).GetDynamicConfiguration(zkUrl) @@ -115,8 +118,11 @@ conditions: _, err = z.Conn.Set(routerPath, []byte(testYML), 0) assert.NoError(t, err) - defer ts.Stop() - defer z.Close() + defer func() { + err = ts.Stop() + assert.NoError(t, err) + z.Close() + }() zkUrl, _ := common.NewURL(fmt.Sprintf(zkFormat, routerLocalIP, ts.Servers[0].Port)) configuration, err := extension.GetConfigCenterFactory(routerZk).GetDynamicConfiguration(zkUrl) @@ -154,8 +160,11 @@ conditions: _, err = z.Conn.Set(routerPath, []byte(testYML), 0) assert.NoError(t, err) - defer ts.Stop() - defer z.Close() + defer func() { + err = ts.Stop() + assert.NoError(t, err) + z.Close() + }() zkUrl, _ := common.NewURL(fmt.Sprintf(zkFormat, routerLocalIP, ts.Servers[0].Port)) configuration, err := extension.GetConfigCenterFactory(routerZk).GetDynamicConfiguration(zkUrl) diff --git a/cluster/router/condition/file_test.go b/cluster/router/condition/file_test.go index bd19a0d18c6692af181ffef77c5cd3f9fc16d67d..9035e9559223e30cc2a56873b5aa0e4432c0a358 100644 --- a/cluster/router/condition/file_test.go +++ b/cluster/router/condition/file_test.go @@ -89,33 +89,41 @@ func TestParseServiceRouterKey(t *testing.T) { assert.Equal(t, "mock-group", grp) assert.Equal(t, "mock-service", srv) assert.Equal(t, "1.0.0", ver) + assert.Nil(t, err) testString = "mock-group/mock-service" grp, srv, ver, err = parseServiceRouterKey(testString) assert.Equal(t, "mock-group", grp) assert.Equal(t, "mock-service", srv) assert.Equal(t, "", ver) + assert.Nil(t, err) testString = "mock-service:1.0.0" grp, srv, ver, err = parseServiceRouterKey(testString) assert.Equal(t, "", grp) assert.Equal(t, "mock-service", srv) assert.Equal(t, "1.0.0", ver) + assert.Nil(t, err) testString = "mock-service" grp, srv, ver, err = parseServiceRouterKey(testString) assert.Equal(t, "", grp) assert.Equal(t, "mock-service", srv) assert.Equal(t, "", ver) + assert.NoError(t, err) testString = "/mock-service:" grp, srv, ver, err = parseServiceRouterKey(testString) assert.Equal(t, "", grp) assert.Equal(t, "mock-service", srv) assert.Equal(t, "", ver) + assert.NoError(t, err) testString = "grp:mock-service:123" grp, srv, ver, err = parseServiceRouterKey(testString) + assert.Equal(t, "", grp) + assert.Equal(t, "", srv) + assert.Equal(t, "", ver) assert.Error(t, err) testString = "" @@ -123,4 +131,5 @@ func TestParseServiceRouterKey(t *testing.T) { assert.Equal(t, "", grp) assert.Equal(t, "", srv) assert.Equal(t, "", ver) + assert.NoError(t, err) } diff --git a/cluster/router/condition/listenable_router.go b/cluster/router/condition/listenable_router.go index 0b47310dbfe9987a593bc2d0d949a76f08052114..102d766a8a787b460c878c42e8327c1a57ea9588 100644 --- a/cluster/router/condition/listenable_router.go +++ b/cluster/router/condition/listenable_router.go @@ -47,8 +47,8 @@ type listenableRouter struct { conditionRouters []*ConditionRouter routerRule *RouterRule url *common.URL - force bool - priority int64 + //force bool + priority int64 } // RouterRule Get RouterRule instance from listenableRouter diff --git a/cluster/router/condition/router.go b/cluster/router/condition/router.go index 2fc33072d33517810f0c9ab3b8351d7bdcfea8b4..0817b32843938346610aa1e66c626e4895468372 100644 --- a/cluster/router/condition/router.go +++ b/cluster/router/condition/router.go @@ -46,6 +46,13 @@ var ( routerPatternReg = regexp.MustCompile(`([&!=,]*)\s*([^&!=,\s]+)`) ) +var ( + emptyMatchPair = MatchPair{ + Matches: gxset.NewSet(), + Mismatches: gxset.NewSet(), + } +) + // ConditionRouter Condition router struct type ConditionRouter struct { Pattern string @@ -221,14 +228,14 @@ func parseRule(rule string) (map[string]MatchPair, error) { condition[content] = pair } case "=": - if &pair == nil { + if pair == emptyMatchPair { var startIndex = getStartIndex(rule) return nil, perrors.Errorf("Illegal route rule \"%s\", The error char '%s' at index %d before \"%d\".", rule, separator, startIndex, startIndex) } values = pair.Matches values.Add(content) case "!=": - if &pair == nil { + if pair == emptyMatchPair { var startIndex = getStartIndex(rule) return nil, perrors.Errorf("Illegal route rule \"%s\", The error char '%s' at index %d before \"%d\".", rule, separator, startIndex, startIndex) } diff --git a/cluster/router/condition/router_test.go b/cluster/router/condition/router_test.go index 3d33ca275828b31ed480926d486c5844dac771c6..a344b64efb5d7be1fe7e5d2a5a4c9d206cfcf5da 100644 --- a/cluster/router/condition/router_test.go +++ b/cluster/router/condition/router_test.go @@ -70,10 +70,12 @@ func TestNewConditionRouter(t *testing.T) { assert.EqualValues(t, router.ThenCondition, thenRule) router, err = NewConditionRouter(nil) + assert.Nil(t, router) assert.Error(t, err) url, _ = common.NewURL(`condition://0.0.0.0:?application=mock-app&category=routers&force=true&priority=1&router=condition&rule=YSAmT4gYiAmIGQ%3D`) router, err = NewConditionRouter(url) + assert.Nil(t, router) assert.Error(t, err) url, _ = common.NewURL(`condition://0.0.0.0:?application=mock-app&category=routers&force=true&router=condition&rule=YSAmIGMgPT4gYiAmIGQ%3D`) diff --git a/cluster/router/healthcheck/default_health_check_test.go b/cluster/router/healthcheck/default_health_check_test.go index 39827c5f050a1a5ac9524345b59e37ec23efb90f..c32a607889fb096fee07e1c391f5f3461aacfbc5 100644 --- a/cluster/router/healthcheck/default_health_check_test.go +++ b/cluster/router/healthcheck/default_health_check_test.go @@ -56,6 +56,7 @@ func TestDefaultHealthCheckerIsHealthy(t *testing.T) { } hc = NewDefaultHealthChecker(url).(*DefaultHealthChecker) healthy = hc.IsHealthy(invoker) + assert.False(t, false, healthy) // the outgoing request is more than OUTSTANDING_REQUEST_COUNT_LIMIT, go to unhealthy assert.False(t, hc.IsHealthy(invoker)) @@ -67,11 +68,13 @@ func TestDefaultHealthCheckerIsHealthy(t *testing.T) { url.SetParam(constant.OUTSTANDING_REQUEST_COUNT_LIMIT_KEY, "1000") hc = NewDefaultHealthChecker(url).(*DefaultHealthChecker) healthy = hc.IsHealthy(invoker) + assert.False(t, false, healthy) assert.False(t, hc.IsHealthy(invoker)) // reset successive failed count and go to healthy request(url, healthCheckMethodTest, 0, false, true) healthy = hc.IsHealthy(invoker) + assert.False(t, false, healthy) assert.True(t, hc.IsHealthy(invoker)) } diff --git a/cluster/router/tag/file.go b/cluster/router/tag/file.go index 94daf1508eb7b3f4d8a8cacdbd6ed634be6852da..a51ae69cf26fa6e7d10444a23cbff339a5a99b3e 100644 --- a/cluster/router/tag/file.go +++ b/cluster/router/tag/file.go @@ -41,7 +41,7 @@ type FileTagRouter struct { router *tagRouter routerRule *RouterRule url *common.URL - force bool + //force bool } // NewFileTagRouter Create file tag router instance with content (from config file) diff --git a/cluster/router/tag/router_rule.go b/cluster/router/tag/router_rule.go index c0a2d763ae7396ae41694f558f443d46084c3357..512d8f10795b04a18947396be8ae7fa6c4f49d4a 100644 --- a/cluster/router/tag/router_rule.go +++ b/cluster/router/tag/router_rule.go @@ -84,9 +84,9 @@ func (t *RouterRule) getTagNames() []string { return result } -func (t *RouterRule) hasTag(tag string) bool { - return len(t.TagNameToAddresses[tag]) > 0 -} +//func (t *RouterRule) hasTag(tag string) bool { +// return len(t.TagNameToAddresses[tag]) > 0 +//} func (t *RouterRule) getAddressToTagNames() map[string][]string { return t.AddressToTagNames @@ -96,10 +96,10 @@ func (t *RouterRule) getTagNameToAddresses() map[string][]string { return t.TagNameToAddresses } -func (t *RouterRule) getTags() []Tag { - return t.Tags -} +//func (t *RouterRule) getTags() []Tag { +// return t.Tags +//} -func (t *RouterRule) setTags(tags []Tag) { - t.Tags = tags -} +//func (t *RouterRule) setTags(tags []Tag) { +// t.Tags = tags +//} diff --git a/cluster/router/tag/tag_router.go b/cluster/router/tag/tag_router.go index c7f53047c1e2beee4545a10302e9f307f06c33d8..984ecb4eeff71dd692cbda8db5e3b87dbdde4254 100644 --- a/cluster/router/tag/tag_router.go +++ b/cluster/router/tag/tag_router.go @@ -53,7 +53,7 @@ type addrMetadata struct { // application name application string // is rule a runtime rule - ruleRuntime bool + //ruleRuntime bool // is rule a force rule ruleForce bool // is rule a valid rule @@ -227,7 +227,7 @@ func (c *tagRouter) Pool(invokers []protocol.Invoker) (router.AddrPool, router.A // fetchRuleIfNecessary fetches, parses rule and register listener for the further change func (c *tagRouter) fetchRuleIfNecessary(invokers []protocol.Invoker) { - if invokers == nil || len(invokers) == 0 { + if len(invokers) == 0 { return } diff --git a/cluster/router/tag/tag_router_test.go b/cluster/router/tag/tag_router_test.go index 3f7b979f3d52d51ab50c94ea32e87b5eb4f9591e..26c4b8352ba1fce4f6204628f6c09309e3b607d3 100644 --- a/cluster/router/tag/tag_router_test.go +++ b/cluster/router/tag/tag_router_test.go @@ -73,8 +73,7 @@ const ( ) var ( - zkFormat = "zookeeper://%s:%d" - conditionFormat = "condition://%s/com.foo.BarService" + zkFormat = "zookeeper://%s:%d" ) // MockInvoker is only mock the Invoker to support test tagRouter @@ -238,7 +237,7 @@ func TestRouteBeijingInvoker(t *testing.T) { type DynamicTagRouter struct { suite.Suite - rule *RouterRule + //rule *RouterRule route *tagRouter zkClient *zookeeper.ZookeeperClient @@ -310,7 +309,8 @@ tags: func (suite *DynamicTagRouter) TearDownTest() { suite.zkClient.Close() - suite.testCluster.Stop() + err := suite.testCluster.Stop() + suite.Nil(err) } func (suite *DynamicTagRouter) TestDynamicTagRouterSetByIPv4() { diff --git a/common/config/environment.go b/common/config/environment.go index 44cdd1fca18bfed306b135fe38ef536779e148aa..c5651a335444e06f12eb5af831d878ffdbbaeb9f 100644 --- a/common/config/environment.go +++ b/common/config/environment.go @@ -34,8 +34,8 @@ import ( // We just have config center configuration which can override configuration in consumer.yaml & provider.yaml. // But for add these features in future ,I finish the environment struct following Environment class in java. type Environment struct { - configCenterFirst bool - externalConfigs sync.Map + configCenterFirst bool + //externalConfigs sync.Map externalConfigMap sync.Map appExternalConfigMap sync.Map dynamicConfiguration config_center.DynamicConfiguration diff --git a/common/constant/key.go b/common/constant/key.go index 9525511cdaac64083cc595e1c0a6327a4ded6f9c..0515094f285a4bf598b04e2ea1ef376325de7ac1 100644 --- a/common/constant/key.go +++ b/common/constant/key.go @@ -17,6 +17,8 @@ package constant +type DubboCtxKey string + const ( ASYNC_KEY = "async" // it's value should be "true" or "false" of string type ) @@ -47,8 +49,8 @@ const ( PORT_KEY = "port" PROTOCOL_KEY = "protocol" PATH_SEPARATOR = "/" - DUBBO_KEY = "dubbo" - SSL_ENABLED_KEY = "ssl-enabled" + //DUBBO_KEY = "dubbo" + SSL_ENABLED_KEY = "ssl-enabled" ) const ( @@ -92,7 +94,7 @@ const ( ) const ( - DUBBOGO_CTX_KEY = "dubbogo-ctx" + DUBBOGO_CTX_KEY = DubboCtxKey("dubbogo-ctx") ) const ( @@ -127,6 +129,7 @@ const ( TAG_ROUTE_PROTOCOL = "tag" PROVIDERS_CATEGORY = "providers" ROUTER_KEY = "router" + EXPORT_KEY = "export" ) const ( @@ -170,6 +173,7 @@ const ( NACOS_NAMESPACE_ID = "namespaceId" NACOS_PASSWORD = "password" NACOS_USERNAME = "username" + NACOS_NOT_LOAD_LOCAL_CACHE = "nacos.not.load.cache" ) const ( @@ -197,7 +201,7 @@ const ( ) const ( - TRACING_REMOTE_SPAN_CTX = "tracing.remote.span.ctx" + TRACING_REMOTE_SPAN_CTX = DubboCtxKey("tracing.remote.span.ctx") ) // Use for router module @@ -237,7 +241,7 @@ const ( Tagkey = "dubbo.tag" // Attachment key in context in invoker - AttachmentKey = "attachment" + AttachmentKey = DubboCtxKey("attachment") ) const ( @@ -264,7 +268,7 @@ const ( // signature format SIGNATURE_STRING_FORMAT = "%s#%s#%s#%s" // key whether enable signature - PARAMTER_SIGNATURE_ENABLE_KEY = "param.sign" + PARAMETER_SIGNATURE_ENABLE_KEY = "param.sign" // consumer CONSUMER = "consumer" // key of access key id @@ -292,7 +296,7 @@ const ( HEALTH_CHECKER = "health.checker" // The name of the default implementation of HealthChecker DEFAULT_HEALTH_CHECKER = "default" - // The key of oustanding-request-limit + // The key of outstanding-request-limit OUTSTANDING_REQUEST_COUNT_LIMIT_KEY = "outstanding.request.limit" // The key of successive-failed-request's threshold SUCCESSIVE_FAILED_REQUEST_THRESHOLD_KEY = "successive.failed.threshold" diff --git a/common/extension/config_post_processor.go b/common/extension/config_post_processor.go new file mode 100644 index 0000000000000000000000000000000000000000..db126b744d54562a7f45b59aec26ef6e950a23a8 --- /dev/null +++ b/common/extension/config_post_processor.go @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package extension + +import ( + "github.com/apache/dubbo-go/config/interfaces" +) + +var ( + processors = make(map[string]interfaces.ConfigPostProcessor) +) + +// SetConfigPostProcessor registers a ConfigPostProcessor with the given name. +func SetConfigPostProcessor(name string, processor interfaces.ConfigPostProcessor) { + processors[name] = processor +} + +// GetConfigPostProcessor finds a ConfigPostProcessor by name. +func GetConfigPostProcessor(name string) interfaces.ConfigPostProcessor { + return processors[name] +} + +// GetConfigPostProcessors returns all registered instances of ConfigPostProcessor. +func GetConfigPostProcessors() []interfaces.ConfigPostProcessor { + ret := make([]interfaces.ConfigPostProcessor, 0, len(processors)) + for _, v := range processors { + ret = append(ret, v) + } + return ret +} diff --git a/common/extension/metadata_service.go b/common/extension/metadata_service.go index e35677d148eee121c3a6c018a128b5d372c6f2c7..08ddbc333e85fbfc328bec15aa76d2a588b11afb 100644 --- a/common/extension/metadata_service.go +++ b/common/extension/metadata_service.go @@ -26,12 +26,15 @@ import ( ) import ( + "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/metadata/service" ) var ( // there will be two types: local or remote metadataServiceInsMap = make(map[string]func() (service.MetadataService, error), 2) + // remoteMetadataService + remoteMetadataService service.MetadataService ) // SetMetadataService will store the msType => creator pair @@ -48,3 +51,17 @@ func GetMetadataService(msType string) (service.MetadataService, error) { "local - github.com/apache/dubbo-go/metadata/service/inmemory, \n"+ "remote - github.com/apache/dubbo-go/metadata/service/remote", msType)) } + +// GetRemoteMetadataService will get a RemoteMetadataService instance +func GetRemoteMetadataService() (service.MetadataService, error) { + if remoteMetadataService != nil { + return remoteMetadataService, nil + } + if creator, ok := metadataServiceInsMap["remote"]; ok { + var err error + remoteMetadataService, err = creator() + return remoteMetadataService, err + } + logger.Warn("could not find the metadata service creator for metadataType: remote") + return nil, perrors.New(fmt.Sprintf("could not find the metadata service creator for metadataType: remote")) +} diff --git a/common/logger/logger.go b/common/logger/logger.go index 63eda231ddd174468602577d8b042bc0664700d0..4a2f07cb30ee6b5840a3915b441ae0a554f5d5cb 100644 --- a/common/logger/logger.go +++ b/common/logger/logger.go @@ -163,6 +163,7 @@ type OpsLogger interface { // SetLoggerLevel use for set logger level func (dl *DubboLogger) SetLoggerLevel(level string) { l := new(zapcore.Level) - l.Set(level) - dl.dynamicLevel.SetLevel(*l) + if err := l.Set(level); err == nil { + dl.dynamicLevel.SetLevel(*l) + } } diff --git a/common/proxy/proxy.go b/common/proxy/proxy.go index d51ce1cc1bf40a8ad25804c797eeed3b88e7d132..55f533cb2b95269c27c2d2eccf96c33af04bbee1 100644 --- a/common/proxy/proxy.go +++ b/common/proxy/proxy.go @@ -66,7 +66,6 @@ func NewProxy(invoke protocol.Invoker, callBack interface{}, attachments map[str // Yyy func(ctx context.Context, args []interface{}, rsp *Zzz) error // } func (p *Proxy) Implement(v common.RPCService) { - // check parameters, incoming interface must be a elem's pointer. valueOf := reflect.ValueOf(v) logger.Debugf("[Implement] reflect.TypeOf: %s", valueOf.String()) @@ -145,7 +144,7 @@ func (p *Proxy) Implement(v common.RPCService) { inv.SetAttachments(k, value) } - // add user setAttachment. It is compatibility with previous versions. + // add user setAttachment. It is compatibility with previous versions. atm := invCtx.Value(constant.AttachmentKey) if m, ok := atm.(map[string]string); ok { for k, value := range m { @@ -159,15 +158,11 @@ func (p *Proxy) Implement(v common.RPCService) { } result := p.invoke.Invoke(invCtx, inv) - if len(result.Attachments()) > 0 { - invCtx = context.WithValue(invCtx, constant.AttachmentKey, result.Attachments()) - } - err = result.Error() if err != nil { // the cause reason err = perrors.Cause(err) - // if some error happened, it should be log some info in the seperate file. + // if some error happened, it should be log some info in the separate file. if throwabler, ok := err.(java_exception.Throwabler); ok { logger.Warnf("invoke service throw exception: %v , stackTraceElements: %v", err.Error(), throwabler.GetStackTrace()) } else { @@ -235,3 +230,8 @@ func (p *Proxy) Get() common.RPCService { func (p *Proxy) GetCallback() interface{} { return p.callBack } + +// GetInvoker gets Invoker. +func (p *Proxy) GetInvoker() protocol.Invoker { + return p.invoke +} diff --git a/common/proxy/proxy_test.go b/common/proxy/proxy_test.go index f31caf990d3e56c472f5510e57367b4845c9c966..c335bf67834074607619edc734f0e0b3c2d72124 100644 --- a/common/proxy/proxy_test.go +++ b/common/proxy/proxy_test.go @@ -19,6 +19,7 @@ package proxy import ( "context" + "fmt" "reflect" "testing" ) @@ -145,11 +146,14 @@ type TestProxyInvoker struct { protocol.BaseInvoker } -func (bi *TestProxyInvoker) Invoke(context context.Context, inv protocol.Invocation) protocol.Result { +func (bi *TestProxyInvoker) Invoke(_ context.Context, inv protocol.Invocation) protocol.Result { rpcInv := inv.(*invocation.RPCInvocation) mapV := inv.Attachments() mapV["TestProxyInvoker"] = "TestProxyInvokerValue" - hessian2.ReflectResponse(mapV, rpcInv.Reply()) + if err := hessian2.ReflectResponse(mapV, rpcInv.Reply()); err != nil { + fmt.Printf("hessian2.ReflectResponse(mapV:%v) = error:%v", mapV, err) + } + return &protocol.RPCResult{ Rest: inv.Arguments(), } diff --git a/common/rpc_service.go b/common/rpc_service.go index 572fc71701c411a7a0a070c2a84e9a4d96da6dfb..30d72c1420f254182f5d2f16c6fc9444881f0b71 100644 --- a/common/rpc_service.go +++ b/common/rpc_service.go @@ -106,10 +106,10 @@ func (m *MethodType) ReplyType() reflect.Type { return m.replyType } -// SuiteContext tranfers @ctx to reflect.Value type or get it from @m.ctxType. +// SuiteContext transfers @ctx to reflect.Value type or get it from @m.ctxType. func (m *MethodType) SuiteContext(ctx context.Context) reflect.Value { - if contextv := reflect.ValueOf(ctx); contextv.IsValid() { - return contextv + if ctxV := reflect.ValueOf(ctx); ctxV.IsValid() { + return ctxV } return reflect.Zero(m.ctxType) } @@ -156,13 +156,13 @@ type serviceMap struct { interfaceMap map[string][]*Service // interface -> service } -// GetService gets a service defination by protocol and name +// GetService gets a service definition by protocol and name func (sm *serviceMap) GetService(protocol, interfaceName, group, version string) *Service { serviceKey := ServiceKey(interfaceName, group, version) return sm.GetServiceByServiceKey(protocol, serviceKey) } -// GetService gets a service defination by protocol and service key +// GetService gets a service definition by protocol and service key func (sm *serviceMap) GetServiceByServiceKey(protocol, serviceKey string) *Service { sm.mutex.RLock() defer sm.mutex.RUnlock() diff --git a/common/rpc_service_test.go b/common/rpc_service_test.go index b50d8d962c4277f702388b74e5137bdf1c8bdf7e..e8bd3933da89b0a6c607f776eae1bb8603f8f467 100644 --- a/common/rpc_service_test.go +++ b/common/rpc_service_test.go @@ -27,6 +27,10 @@ import ( "github.com/stretchr/testify/assert" ) +import ( + "github.com/apache/dubbo-go/common/constant" +) + const ( referenceTestPath = "com.test.Path" referenceTestPathDistinct = "com.test.Path1" @@ -125,21 +129,20 @@ func TestServiceMapUnRegister(t *testing.T) { err = ServiceMap.UnRegister("", testProtocol, ServiceKey("TestService", "", "v0")) assert.EqualError(t, err, "no service for TestService:v0") - // succ + // success err = ServiceMap.UnRegister("TestService", testProtocol, ServiceKey("TestService", "", "v1")) assert.NoError(t, err) } func TestMethodTypeSuiteContext(t *testing.T) { mt := &MethodType{ctxType: reflect.TypeOf(context.TODO())} - ctx := context.WithValue(context.Background(), "key", "value") + ctx := context.Background() + key := constant.DubboCtxKey("key") + ctx = context.WithValue(ctx, key, "value") assert.Equal(t, reflect.ValueOf(ctx), mt.SuiteContext(ctx)) - - assert.Equal(t, reflect.Zero(mt.ctxType), mt.SuiteContext(nil)) } func TestSuiteMethod(t *testing.T) { - s := &TestService{} method, ok := reflect.TypeOf(s).MethodByName("MethodOne") assert.True(t, ok) diff --git a/common/url.go b/common/url.go index 81f076043e71bf89d91121b185ce7fad843bc764..80b85fcf42a924f4707c9ab31e2ec263c671e55a 100644 --- a/common/url.go +++ b/common/url.go @@ -21,7 +21,6 @@ import ( "bytes" "encoding/base64" "fmt" - cm "github.com/Workiva/go-datastructures/common" "math" "net" "net/url" @@ -31,6 +30,7 @@ import ( ) import ( + cm "github.com/Workiva/go-datastructures/common" gxset "github.com/dubbogo/gost/container/set" "github.com/jinzhu/copier" perrors "github.com/pkg/errors" @@ -64,8 +64,14 @@ var ( DubboNodes = [...]string{"consumers", "configurators", "routers", "providers"} // DubboRole Dubbo service role DubboRole = [...]string{"consumer", "", "routers", "provider"} + // CompareURLEqualFunc compare two url is equal + compareURLEqualFunc CompareURLEqualFunc ) +func init() { + compareURLEqualFunc = defaultCompareURLEqual +} + // nolint type RoleType int @@ -83,9 +89,7 @@ type baseUrl struct { Location string // ip+port Ip string Port string - //url.Values is not safe map, add to avoid concurrent map read and map write error - paramsLock sync.RWMutex - params url.Values + PrimitiveURL string } @@ -109,6 +113,10 @@ type URL struct { noCopy noCopy baseUrl + //url.Values is not safe map, add to avoid concurrent map read and map write error + paramsLock sync.RWMutex + params url.Values + Path string // like /com.ikurento.dubbo.UserProvider Username string Password string @@ -211,12 +219,12 @@ func WithToken(token string) Option { // NewURLWithOptions will create a new url with options func NewURLWithOptions(opts ...Option) *URL { - newUrl := &URL{} + newURL := &URL{} for _, opt := range opts { - opt(newUrl) + opt(newURL) } - newUrl.Location = newUrl.Ip + ":" + newUrl.Port - return newUrl + newURL.Location = newURL.Ip + ":" + newURL.Port + return newURL } // NewURL will create a new url @@ -408,6 +416,9 @@ func (c *URL) Service() string { func (c *URL) AddParam(key string, value string) { c.paramsLock.Lock() defer c.paramsLock.Unlock() + if c.params == nil { + c.params = url.Values{} + } c.params.Add(key, value) } @@ -426,9 +437,29 @@ func (c *URL) AddParamAvoidNil(key string, value string) { func (c *URL) SetParam(key string, value string) { c.paramsLock.Lock() defer c.paramsLock.Unlock() + if c.params == nil { + c.params = url.Values{} + } c.params.Set(key, value) } +// DelParam will delete the given key from the url +func (c *URL) DelParam(key string) { + c.paramsLock.Lock() + defer c.paramsLock.Unlock() + if c.params != nil { + c.params.Del(key) + } +} + +// ReplaceParams will replace the URL.params +// usually it should only be invoked when you want to modify an url, such as MergeURL +func (c *URL) ReplaceParams(param url.Values) { + c.paramsLock.Lock() + defer c.paramsLock.Unlock() + c.params = param +} + // RangeParams will iterate the params func (c *URL) RangeParams(f func(key, value string) bool) { c.paramsLock.RLock() @@ -444,10 +475,15 @@ func (c *URL) RangeParams(f func(key, value string) bool) { func (c *URL) GetParam(s string, d string) string { c.paramsLock.RLock() defer c.paramsLock.RUnlock() - r := c.params.Get(s) + + var r string + if len(c.params) > 0 { + r = c.params.Get(s) + } if len(r) == 0 { r = d } + return r } @@ -623,22 +659,26 @@ func (c *URL) ToMap() map[string]string { // You should notice that the value of b1 is v2, not v4. // due to URL is not thread-safe, so this method is not thread-safe func MergeUrl(serviceUrl *URL, referenceUrl *URL) *URL { + // After Clone, it is a new url that there is no thread safe issue. mergedUrl := serviceUrl.Clone() - + params := mergedUrl.GetParams() // iterator the referenceUrl if serviceUrl not have the key ,merge in - referenceUrl.RangeParams(func(key, value string) bool { + // referenceUrl usually will not changed. so change RangeParams to GetParams to avoid the string value copy. + for key, value := range referenceUrl.GetParams() { if v := mergedUrl.GetParam(key, ""); len(v) == 0 { - mergedUrl.SetParam(key, value) + if len(value) > 0 { + params[key] = value + } } - return true - }) + } + // loadBalance,cluster,retries strategy config - methodConfigMergeFcn := mergeNormalParam(mergedUrl, referenceUrl, []string{constant.LOADBALANCE_KEY, constant.CLUSTER_KEY, constant.RETRIES_KEY, constant.TIMEOUT_KEY}) + methodConfigMergeFcn := mergeNormalParam(params, referenceUrl, []string{constant.LOADBALANCE_KEY, constant.CLUSTER_KEY, constant.RETRIES_KEY, constant.TIMEOUT_KEY}) // remote timestamp if v := serviceUrl.GetParam(constant.TIMESTAMP_KEY, ""); len(v) > 0 { - mergedUrl.SetParam(constant.REMOTE_TIMESTAMP_KEY, v) - mergedUrl.SetParam(constant.TIMESTAMP_KEY, referenceUrl.GetParam(constant.TIMESTAMP_KEY, "")) + params[constant.REMOTE_TIMESTAMP_KEY] = []string{v} + params[constant.TIMESTAMP_KEY] = []string{referenceUrl.GetParam(constant.TIMESTAMP_KEY, "")} } // finally execute methodConfigMergeFcn @@ -647,33 +687,41 @@ func MergeUrl(serviceUrl *URL, referenceUrl *URL) *URL { fcn("methods." + method) } } - + // In this way, we will raise some performance. + mergedUrl.ReplaceParams(params) return mergedUrl } // Clone will copy the url func (c *URL) Clone() *URL { - newUrl := &URL{} - copier.Copy(newUrl, c) - newUrl.params = url.Values{} + newURL := &URL{} + if err := copier.Copy(newURL, c); err != nil { + // this is impossible + return newURL + } + newURL.params = url.Values{} c.RangeParams(func(key, value string) bool { - newUrl.SetParam(key, value) + newURL.SetParam(key, value) return true }) - return newUrl + + return newURL } func (c *URL) CloneExceptParams(excludeParams *gxset.HashSet) *URL { - newUrl := &URL{} - copier.Copy(newUrl, c) - newUrl.params = url.Values{} + newURL := &URL{} + if err := copier.Copy(newURL, c); err != nil { + // this is impossible + return newURL + } + newURL.params = url.Values{} c.RangeParams(func(key, value string) bool { if !excludeParams.Contains(key) { - newUrl.SetParam(key, value) + newURL.SetParam(key, value) } return true }) - return newUrl + return newURL } func (c *URL) Compare(comp cm.Comparator) int { @@ -713,6 +761,9 @@ func (c *URL) CloneWithParams(reserveParams []string) *URL { // IsEquals compares if two URLs equals with each other. Excludes are all parameter keys which should ignored. func IsEquals(left *URL, right *URL, excludes ...string) bool { + if (left == nil && right != nil) || (right == nil && left != nil) { + return false + } if left.Ip != right.Ip || left.Port != right.Port { return false } @@ -739,15 +790,15 @@ func IsEquals(left *URL, right *URL, excludes ...string) bool { return true } -func mergeNormalParam(mergedUrl *URL, referenceUrl *URL, paramKeys []string) []func(method string) { +func mergeNormalParam(params url.Values, referenceUrl *URL, paramKeys []string) []func(method string) { methodConfigMergeFcn := make([]func(method string), 0, len(paramKeys)) for _, paramKey := range paramKeys { if v := referenceUrl.GetParam(paramKey, ""); len(v) > 0 { - mergedUrl.SetParam(paramKey, v) + params[paramKey] = []string{v} } methodConfigMergeFcn = append(methodConfigMergeFcn, func(method string) { if v := referenceUrl.GetParam(method+"."+paramKey, ""); len(v) > 0 { - mergedUrl.SetParam(method+"."+paramKey, v) + params[method+"."+paramKey] = []string{v} } }) } @@ -772,3 +823,17 @@ func (s URLSlice) Less(i, j int) bool { func (s URLSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } + +type CompareURLEqualFunc func(l *URL, r *URL, excludeParam ...string) bool + +func defaultCompareURLEqual(l *URL, r *URL, excludeParam ...string) bool { + return IsEquals(l, r, excludeParam...) +} + +func SetCompareURLEqualFunc(f CompareURLEqualFunc) { + compareURLEqualFunc = f +} + +func GetCompareURLEqualFunc() CompareURLEqualFunc { + return compareURLEqualFunc +} diff --git a/common/url_test.go b/common/url_test.go index 05377c19c93eb3c13021966e4b2684d4910ddaab..c645f1a046777ddf298b54ae5cb19124dd7808c1 100644 --- a/common/url_test.go +++ b/common/url_test.go @@ -68,12 +68,17 @@ func TestURL(t *testing.T) { "side=provider&timeout=3000×tamp=1556509797245") assert.NoError(t, err) + urlInst := URL{} + urlInst.noCopy.Lock() + urlInst.SetParam("hello", "world") + urlInst.noCopy.Unlock() + assert.Equal(t, "/com.ikurento.user.UserProvider", u.Path) assert.Equal(t, "127.0.0.1:20000", u.Location) assert.Equal(t, "dubbo", u.Protocol) assert.Equal(t, loopbackAddress, u.Ip) assert.Equal(t, "20000", u.Port) - assert.Equal(t, URL{}.Methods, u.Methods) + assert.Equal(t, urlInst.Methods, u.Methods) assert.Equal(t, "", u.Username) assert.Equal(t, "", u.Password) assert.Equal(t, "anyhost=true&application=BDTService&category=providers&default.timeout=10000&dubbo=dubbo-"+ @@ -156,7 +161,10 @@ func TestURLEqual(t *testing.T) { func TestURLGetParam(t *testing.T) { params := url.Values{} params.Set("key", "value") - u := URL{baseUrl: baseUrl{params: params}} + + u := URL{} + u.SetParams(params) + v := u.GetParam("key", "default") assert.Equal(t, "value", v) @@ -167,8 +175,11 @@ func TestURLGetParam(t *testing.T) { func TestURLGetParamInt(t *testing.T) { params := url.Values{} - params.Set("key", "") - u := URL{baseUrl: baseUrl{params: params}} + params.Set("key", "value") + + u := URL{} + u.SetParams(params) + v := u.GetParamInt("key", 1) assert.Equal(t, int64(1), v) @@ -180,7 +191,10 @@ func TestURLGetParamInt(t *testing.T) { func TestURLGetParamIntValue(t *testing.T) { params := url.Values{} params.Set("key", "0") - u := URL{baseUrl: baseUrl{params: params}} + + u := URL{} + u.SetParams(params) + v := u.GetParamInt("key", 1) assert.Equal(t, int64(0), v) @@ -192,7 +206,10 @@ func TestURLGetParamIntValue(t *testing.T) { func TestURLGetParamBool(t *testing.T) { params := url.Values{} params.Set("force", "true") - u := URL{baseUrl: baseUrl{params: params}} + + u := URL{} + u.SetParams(params) + v := u.GetParamBool("force", false) assert.Equal(t, true, v) @@ -205,7 +222,10 @@ func TestURLGetParamAndDecoded(t *testing.T) { rule := "host = 2.2.2.2,1.1.1.1,3.3.3.3 & host !=1.1.1.1 => host = 1.2.3.4" params := url.Values{} params.Set("rule", base64.URLEncoding.EncodeToString([]byte(rule))) - u := URL{baseUrl: baseUrl{params: params}} + + u := URL{} + u.SetParams(params) + v, _ := u.GetParamAndDecoded("rule") assert.Equal(t, rule, v) } @@ -242,7 +262,10 @@ func TestURLToMap(t *testing.T) { func TestURLGetMethodParamInt(t *testing.T) { params := url.Values{} params.Set("methods.GetValue.timeout", "3") - u := URL{baseUrl: baseUrl{params: params}} + + u := URL{} + u.SetParams(params) + v := u.GetMethodParamInt("GetValue", "timeout", 1) assert.Equal(t, int64(3), v) @@ -254,7 +277,10 @@ func TestURLGetMethodParamInt(t *testing.T) { func TestURLGetMethodParam(t *testing.T) { params := url.Values{} params.Set("methods.GetValue.timeout", "3s") - u := URL{baseUrl: baseUrl{params: params}} + + u := URL{} + u.SetParams(params) + v := u.GetMethodParam("GetValue", "timeout", "1s") assert.Equal(t, "3s", v) @@ -266,7 +292,10 @@ func TestURLGetMethodParam(t *testing.T) { func TestURLGetMethodParamBool(t *testing.T) { params := url.Values{} params.Set("methods.GetValue.async", "true") - u := URL{baseUrl: baseUrl{params: params}} + + u := URL{} + u.SetParams(params) + v := u.GetMethodParamBool("GetValue", "async", false) assert.Equal(t, true, v) @@ -307,6 +336,16 @@ func TestURLSetParams(t *testing.T) { assert.Equal(t, "2.6.0", u1.GetParam("version", "")) } +func TestURLReplaceParams(t *testing.T) { + u1, err := NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?interface=com.ikurento.user.UserProvider&group=&version=2.6.0&configVersion=1.0") + assert.NoError(t, err) + params := url.Values{} + params.Set("key", "3") + u1.ReplaceParams(params) + assert.Equal(t, "3", u1.GetParam("key", "")) + assert.Equal(t, "", u1.GetParam("version", "")) +} + func TestClone(t *testing.T) { u1, err := NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?interface=com.ikurento.user.UserProvider&group=&version=2.6.0&configVersion=1.0") assert.NoError(t, err) @@ -329,5 +368,56 @@ func TestColonSeparatedKey(t *testing.T) { assert.Equal(t, u1.ColonSeparatedKey(), u1.GetParam(constant.INTERFACE_KEY, "")+":version1:group1") u1.SetParam(constant.VERSION_KEY, "") assert.Equal(t, u1.ColonSeparatedKey(), u1.GetParam(constant.INTERFACE_KEY, "")+"::group1") +} + +func TestCompareURLEqualFunc(t *testing.T) { + // test Default + url1, _ := NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&" + + "application=BDTService&category=providers&default.timeout=10000&dubbo=dubbo-provider-golang-1.0.0&" + + "environment=dev&interface=com.ikurento.user.UserProvider&ip=192.168.56.1&methods=GetUser%2C&" + + "module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&" + + "side=provider&timeout=3000×tamp=1556509797245") + url2, _ := NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&" + + "application=BDTService&category=providers&default.timeout=10000&dubbo=dubbo-provider-golang-1.0.0&" + + "environment=dev&interface=com.ikurento.user.UserProvider&ip=192.168.56.1&methods=GetUser%2C&" + + "module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&" + + "side=provider&timeout=3000×tamp=155650979798") + assert.False(t, GetCompareURLEqualFunc()(url1, url2)) + assert.True(t, GetCompareURLEqualFunc()(url1, url2, constant.TIMESTAMP_KEY, constant.REMOTE_TIMESTAMP_KEY)) + + // test custom + url1, _ = NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&" + + "application=BDTService&category=providers&default.timeout=10000&dubbo=dubbo-provider-golang-1.0.0&" + + "environment=dev&interface=com.ikurento.user.UserProvider&ip=192.168.56.1&methods=GetUser%2C&" + + "module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&" + + "side=provider&timeout=3000×tamp=1556509797245") + url2, _ = NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&" + + "application=BDTService&category=providers&default.timeout=10000&dubbo=dubbo-provider-golang-1.0.0&" + + "environment=dev&interface=com.ikurento.user.UserProvider&ip=192.168.56.1&methods=GetUser%2C&" + + "module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&" + + "side=provider&timeout=3000×tamp=155650979798") + assert.True(t, GetCompareURLEqualFunc()(url1, url2, constant.TIMESTAMP_KEY, constant.REMOTE_TIMESTAMP_KEY)) + SetCompareURLEqualFunc(CustomCompareURLEqual) + assert.False(t, GetCompareURLEqualFunc()(url1, url2)) + assert.False(t, GetCompareURLEqualFunc()(url1, url2, constant.TIMESTAMP_KEY, constant.REMOTE_TIMESTAMP_KEY)) + + url1, _ = NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&" + + "application=BDTService&category=providers&default.timeout=10000&dubbo=dubbo-provider-golang-1.0.0&" + + "environment=dev&interface=com.ikurento.user.UserProvider&ip=192.168.56.1&methods=GetUser%2C&" + + "module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&" + + "side=provider&timeout=3000") + url2, _ = NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&" + + "application=BDTService&category=providers&default.timeout=10000&dubbo=dubbo-provider-golang-1.0.0&" + + "environment=dev&interface=com.ikurento.user.UserProvider&ip=192.168.56.1&methods=GetUser%2C&" + + "module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&" + + "side=provider&timeout=3000") + assert.True(t, GetCompareURLEqualFunc()(url1, url2)) + assert.True(t, GetCompareURLEqualFunc()(url1, url2, constant.TIMESTAMP_KEY, constant.REMOTE_TIMESTAMP_KEY)) + SetCompareURLEqualFunc(CustomCompareURLEqual) + assert.True(t, GetCompareURLEqualFunc()(url1, url2)) + assert.True(t, GetCompareURLEqualFunc()(url1, url2, constant.TIMESTAMP_KEY, constant.REMOTE_TIMESTAMP_KEY)) +} +func CustomCompareURLEqual(l *URL, r *URL, execludeParam ...string) bool { + return l.PrimitiveURL == r.PrimitiveURL } diff --git a/common/yaml/yaml_test.go b/common/yaml/yaml_test.go index 5a271a25823f576cb9cdb10c657520bbf5666017..19f4fe148aace5baf4790f329aa228506c8b5f70 100644 --- a/common/yaml/yaml_test.go +++ b/common/yaml/yaml_test.go @@ -66,5 +66,5 @@ type Config struct { } type ChildConfig struct { - StrTest string `default:"strTest" default:"default" yaml:"strTest" json:"strTest,omitempty"` + StrTest string `default:"default" yaml:"strTest" json:"strTest,omitempty"` } diff --git a/config/application_config.go b/config/application_config.go index ef99664fa298c28365ed7acc54d0c18a88c9b5c2..6fe6c5d049f8ce95a56fcfd62eb1cffc03bf3c43 100644 --- a/config/application_config.go +++ b/config/application_config.go @@ -48,8 +48,5 @@ func (c *ApplicationConfig) UnmarshalYAML(unmarshal func(interface{}) error) err return err } type plain ApplicationConfig - if err := unmarshal((*plain)(c)); err != nil { - return err - } - return nil + return unmarshal((*plain)(c)) } diff --git a/config/base_config.go b/config/base_config.go index 336bb03c7b61ad8aad8465bb3c7754abeb9e9f5a..7cb25a50793b94f2ec2fd8c60e6b93a50b8e77ab 100644 --- a/config/base_config.go +++ b/config/base_config.go @@ -33,10 +33,6 @@ import ( "github.com/apache/dubbo-go/common/logger" ) -type multiConfiger interface { - Prefix() string -} - // BaseConfig is the common configuration for provider and consumer type BaseConfig struct { ConfigCenterConfig *ConfigCenterConfig `yaml:"config_center" json:"config_center,omitempty"` @@ -49,7 +45,7 @@ type BaseConfig struct { // application config ApplicationConfig *ApplicationConfig `yaml:"application" json:"application,omitempty" property:"application"` - prefix string + //prefix string fatherConfig interface{} EventDispatcherType string `default:"direct" yaml:"event_dispatcher_type" json:"event_dispatcher_type,omitempty"` MetricConfig *MetricConfig `yaml:"metrics" json:"metrics,omitempty"` diff --git a/config/base_config_test.go b/config/base_config_test.go index 849a9c4586c0c8cd2d74e3dd1011aaab466f0e93..566b49bea7df8a14543347a196d136a8c059a0b5 100644 --- a/config/base_config_test.go +++ b/config/base_config_test.go @@ -17,7 +17,6 @@ package config import ( - "fmt" "reflect" "testing" ) @@ -108,6 +107,7 @@ var baseMockRef = map[string]*ReferenceConfig{ func TestRefresh(t *testing.T) { c := &BaseConfig{} + c.fileStream = nil mockMap := getMockMap() mockMap["dubbo.shutdown.timeout"] = "12s" @@ -285,8 +285,7 @@ func TestInitializeStruct(t *testing.T) { tp := reflect.TypeOf(ConsumerConfig{}) v := reflect.New(tp) initializeStruct(tp, v.Elem()) - fmt.Println(reflect.ValueOf(testConsumerConfig).Elem().Type().String()) - fmt.Println(v.Elem().Type().String()) + t.Logf("testConsumerConfig type:%s", reflect.ValueOf(testConsumerConfig).Elem().Type().String()) reflect.ValueOf(testConsumerConfig).Elem().Set(v.Elem()) assert.Condition(t, func() (success bool) { diff --git a/config/config_center_config.go b/config/config_center_config.go index 752d9d45855c886a1d5122c6e7832196c7e9413b..940b7be951d83a041ebc8121e65a9bd2fd09594b 100644 --- a/config/config_center_config.go +++ b/config/config_center_config.go @@ -18,14 +18,13 @@ package config import ( - "context" "net/url" "reflect" - "time" ) import ( "github.com/creasty/defaults" + perrors "github.com/pkg/errors" ) import ( @@ -35,7 +34,6 @@ import ( "github.com/apache/dubbo-go/common/extension" "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/config_center" - perrors "github.com/pkg/errors" ) // ConfigCenterConfig is configuration for config center @@ -46,7 +44,7 @@ import ( // // ConfigCenter has currently supported Zookeeper, Nacos, Etcd, Consul, Apollo type ConfigCenterConfig struct { - context context.Context + //context context.Context Protocol string `required:"true" yaml:"protocol" json:"protocol,omitempty"` Address string `yaml:"address" json:"address,omitempty"` Cluster string `yaml:"cluster" json:"cluster,omitempty"` @@ -60,7 +58,7 @@ type ConfigCenterConfig struct { AppId string `default:"dubbo" yaml:"app_id" json:"app_id,omitempty"` TimeoutStr string `yaml:"timeout" json:"timeout,omitempty"` RemoteRef string `required:"false" yaml:"remote_ref" json:"remote_ref,omitempty"` - timeout time.Duration + //timeout time.Duration } // UnmarshalYAML unmarshals the ConfigCenterConfig by @unmarshal function @@ -69,10 +67,7 @@ func (c *ConfigCenterConfig) UnmarshalYAML(unmarshal func(interface{}) error) er return err } type plain ConfigCenterConfig - if err := unmarshal((*plain)(c)); err != nil { - return err - } - return nil + return unmarshal((*plain)(c)) } // GetUrlMap gets url map from ConfigCenterConfig diff --git a/config/config_loader.go b/config/config_loader.go index ec591aad6526e5841656465e71465413d01ad5ba..35910981d128bdca7d63973328e2752ecfef6933 100644 --- a/config/config_loader.go +++ b/config/config_loader.go @@ -406,9 +406,9 @@ func GetBaseConfig() *BaseConfig { baseConfig = &BaseConfig{ MetricConfig: &MetricConfig{}, ConfigCenterConfig: &ConfigCenterConfig{}, - Remotes: make(map[string]*RemoteConfig, 0), + Remotes: make(map[string]*RemoteConfig), ApplicationConfig: &ApplicationConfig{}, - ServiceDiscoveries: make(map[string]*ServiceDiscoveryConfig, 0), + ServiceDiscoveries: make(map[string]*ServiceDiscoveryConfig), } } } diff --git a/config/config_loader_test.go b/config/config_loader_test.go index c3c3eb93526a51fe8f2041b17049144b4ec7b703..5cda3b2a99fb1f8219fba762c097d8369ba07fdc 100644 --- a/config/config_loader_test.go +++ b/config/config_loader_test.go @@ -27,7 +27,7 @@ import ( import ( "github.com/Workiva/go-datastructures/slice/skip" gxset "github.com/dubbogo/gost/container/set" - gxpage "github.com/dubbogo/gost/page" + gxpage "github.com/dubbogo/gost/hash/page" "github.com/stretchr/testify/assert" "go.uber.org/atomic" ) @@ -104,7 +104,8 @@ func TestLoad(t *testing.T) { conServices = map[string]common.RPCService{} proServices = map[string]common.RPCService{} - err := common.ServiceMap.UnRegister("com.MockService", "mock", common.ServiceKey("com.MockService", "huadong_idc", "1.0.0")) + err := common.ServiceMap.UnRegister("com.MockService", "mock", + common.ServiceKey("com.MockService", "huadong_idc", "1.0.0")) assert.Nil(t, err) consumerConfig = nil providerConfig = nil @@ -182,6 +183,9 @@ func TestWithNoRegLoad(t *testing.T) { conServices = map[string]common.RPCService{} proServices = map[string]common.RPCService{} + err := common.ServiceMap.UnRegister("com.MockService", "mock", + common.ServiceKey("com.MockService", "huadong_idc", "1.0.0")) + assert.Nil(t, err) common.ServiceMap.UnRegister("com.MockService", "mock", common.ServiceKey("com.MockService", "huadong_idc", "1.0.0")) consumerConfig = nil providerConfig = nil @@ -203,10 +207,12 @@ func TestConfigLoaderWithConfigCenter(t *testing.T) { assert.Equal(t, ProviderConfig{}, GetProviderConfig()) err = ConsumerInit(conPath) - configCenterRefreshConsumer() + assert.NoError(t, err) + err = configCenterRefreshConsumer() assert.NoError(t, err) err = ProviderInit(proPath) - configCenterRefreshProvider() + assert.NoError(t, err) + err = configCenterRefreshProvider() assert.NoError(t, err) assert.NotNil(t, consumerConfig) @@ -256,13 +262,15 @@ func TestConfigLoaderWithConfigCenterSingleRegistry(t *testing.T) { assert.Equal(t, ProviderConfig{}, GetProviderConfig()) err = ConsumerInit(conPath) + assert.NoError(t, err) checkApplicationName(consumerConfig.ApplicationConfig) - configCenterRefreshConsumer() + err = configCenterRefreshConsumer() checkRegistries(consumerConfig.Registries, consumerConfig.Registry) assert.NoError(t, err) err = ProviderInit(proPath) + assert.NoError(t, err) checkApplicationName(providerConfig.ApplicationConfig) - configCenterRefreshProvider() + err = configCenterRefreshProvider() checkRegistries(providerConfig.Registries, providerConfig.Registry) assert.NoError(t, err) diff --git a/config/consumer_config.go b/config/consumer_config.go index c8083603e12570a4492dd63a749adb4aa89663c8..ff53366c45406dde8e4c0daac7a5d68aa6bd8934 100644 --- a/config/consumer_config.go +++ b/config/consumer_config.go @@ -71,10 +71,7 @@ func (c *ConsumerConfig) UnmarshalYAML(unmarshal func(interface{}) error) error return err } type plain ConsumerConfig - if err := unmarshal((*plain)(c)); err != nil { - return err - } - return nil + return unmarshal((*plain)(c)) } // nolint diff --git a/config/interfaces/config_post_processor.go b/config/interfaces/config_post_processor.go new file mode 100644 index 0000000000000000000000000000000000000000..53dd71780ff0807065e8c4b0e00ab4fe8b6a4823 --- /dev/null +++ b/config/interfaces/config_post_processor.go @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package interfaces + +import ( + "github.com/apache/dubbo-go/common" +) + +// ConfigPostProcessor is an extension to give users a chance to customize configs against ReferenceConfig and +// ServiceConfig during deployment time. +type ConfigPostProcessor interface { + // PostProcessReferenceConfig customizes ReferenceConfig's params. + PostProcessReferenceConfig(*common.URL) + + // PostProcessServiceConfig customizes ServiceConfig's params. + PostProcessServiceConfig(*common.URL) +} diff --git a/config/method_config.go b/config/method_config.go index b64306fd6aa865d219506ea2722067619b00fea7..db52940c3db6b4b81b0467945b538c9b540cd46a 100644 --- a/config/method_config.go +++ b/config/method_config.go @@ -57,8 +57,5 @@ func (c *MethodConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { return err } type plain MethodConfig - if err := unmarshal((*plain)(c)); err != nil { - return err - } - return nil + return unmarshal((*plain)(c)) } diff --git a/config/provider_config.go b/config/provider_config.go index fcb429b6400936f72c09035968b4d4c72387246c..0aee5600298233b764df75b02c745a3ec8d9faef 100644 --- a/config/provider_config.go +++ b/config/provider_config.go @@ -58,10 +58,7 @@ func (c *ProviderConfig) UnmarshalYAML(unmarshal func(interface{}) error) error return err } type plain ProviderConfig - if err := unmarshal((*plain)(c)); err != nil { - return err - } - return nil + return unmarshal((*plain)(c)) } // nolint diff --git a/config/reference_config.go b/config/reference_config.go index e616a3595b85effa25534146e659fae5f0996b41..895ab9df26399c1c9a1296e44fba8a284ba2fb6c 100644 --- a/config/reference_config.go +++ b/config/reference_config.go @@ -86,11 +86,7 @@ func (c *ReferenceConfig) UnmarshalYAML(unmarshal func(interface{}) error) error } *c = ReferenceConfig(raw) - if err := defaults.Set(c); err != nil { - return err - } - - return nil + return defaults.Set(c) } // Refer ... @@ -104,6 +100,9 @@ func (c *ReferenceConfig) Refer(_ interface{}) { if c.ForceTag { cfgURL.AddParam(constant.ForceUseTag, "true") } + + c.postProcessConfig(cfgURL) + if c.Url != "" { // 1. user specified URL, could be peer-to-peer address, or register center's address. urlStrings := gxstrings.RegSplit(c.Url, "\\s*[;]+\\s*") @@ -168,7 +167,8 @@ func (c *ReferenceConfig) Refer(_ interface{}) { // FailoverClusterInvoker(RegistryDirectory, routing happens here) -> Invoker c.invoker = cluster.Join(directory.NewStaticDirectory(invokers)) } - + // publish consumer metadata + publishConsumerDefinition(cfgURL) // create proxy if c.Async { callback := GetCallback(c.id) @@ -189,6 +189,11 @@ func (c *ReferenceConfig) GetRPCService() common.RPCService { return c.pxy.Get() } +// GetProxy gets proxy +func (c *ReferenceConfig) GetProxy() *proxy.Proxy { + return c.pxy +} + func (c *ReferenceConfig) getUrlMap() url.Values { urlMap := url.Values{} //first set user params @@ -252,3 +257,16 @@ func (c *ReferenceConfig) GenericLoad(id string) { c.Refer(genericService) c.Implement(genericService) } + +func publishConsumerDefinition(url *common.URL) { + if remoteMetadataService, err := extension.GetRemoteMetadataService(); err == nil && remoteMetadataService != nil { + remoteMetadataService.PublishServiceDefinition(url) + } +} + +// postProcessConfig asks registered ConfigPostProcessor to post-process the current ReferenceConfig. +func (c *ReferenceConfig) postProcessConfig(url *common.URL) { + for _, p := range extension.GetConfigPostProcessors() { + p.PostProcessReferenceConfig(url) + } +} diff --git a/config/registry_config.go b/config/registry_config.go index 5aff45dc9f4dd20022255ada04cff78bbf295f3e..ed81a07c637e5de2972bbbd21dab8847c3d42f78 100644 --- a/config/registry_config.go +++ b/config/registry_config.go @@ -63,10 +63,7 @@ func (c *RegistryConfig) UnmarshalYAML(unmarshal func(interface{}) error) error return err } type plain RegistryConfig - if err := unmarshal((*plain)(c)); err != nil { - return err - } - return nil + return unmarshal((*plain)(c)) } // nolint diff --git a/config/registry_config_test.go b/config/registry_config_test.go index 6e5dedc34ff5489fc190841bce73cd015eb78132..8bd2de1735496ab9e785759609d8bc3459fc1505 100644 --- a/config/registry_config_test.go +++ b/config/registry_config_test.go @@ -17,7 +17,6 @@ package config import ( - "fmt" "testing" ) @@ -43,7 +42,7 @@ func TestLoadRegistries(t *testing.T) { }, } urls := loadRegistries(target, regs, common.CONSUMER) - fmt.Println(urls[0]) + t.Logf("loadRegistries() = urls:%v", urls) assert.Equal(t, "127.0.0.2:2181,128.0.0.1:2181", urls[0].Location) } @@ -61,6 +60,6 @@ func TestLoadRegistries1(t *testing.T) { }, } urls := loadRegistries(target, regs, common.CONSUMER) - fmt.Println(urls[0]) + t.Logf("loadRegistries() = urls:%v", urls) assert.Equal(t, "127.0.0.2:2181", urls[0].Location) } diff --git a/config/service_config.go b/config/service_config.go index 32104f03ddba1c7a24a43a7989287a9b711565e7..e8523bdea7aa014836580b7ce33fe215c145289d 100644 --- a/config/service_config.go +++ b/config/service_config.go @@ -78,6 +78,7 @@ type ServiceConfig struct { Protocols map[string]*ProtocolConfig unexported *atomic.Bool exported *atomic.Bool + export bool // a flag to control whether the current service should export or not rpcService common.RPCService cacheMutex sync.Mutex cacheProtocol protocol.Protocol @@ -102,6 +103,7 @@ func (c *ServiceConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { } c.exported = atomic.NewBool(false) c.unexported = atomic.NewBool(false) + c.export = true return nil } @@ -112,6 +114,7 @@ func NewServiceConfig(id string, context context.Context) *ServiceConfig { id: id, unexported: atomic.NewBool(false), exported: atomic.NewBool(false), + export: true, } } @@ -173,7 +176,8 @@ func (c *ServiceConfig) Export() error { // registry the service reflect methods, err := common.ServiceMap.Register(c.InterfaceName, proto.Name, c.Group, c.Version, c.rpcService) if err != nil { - formatErr := perrors.Errorf("The service %v export the protocol %v error! Error message is %v.", c.InterfaceName, proto.Name, err.Error()) + formatErr := perrors.Errorf("The service %v export the protocol %v error! Error message is %v.", + c.InterfaceName, proto.Name, err.Error()) logger.Errorf(formatErr.Error()) return formatErr } @@ -198,6 +202,13 @@ func (c *ServiceConfig) Export() error { ivkURL.AddParam(constant.Tagkey, c.Tag) } + // post process the URL to be exported + c.postProcessConfig(ivkURL) + // config post processor may set "export" to false + if !ivkURL.GetParamBool(constant.EXPORT_KEY, true) { + return nil + } + if len(regUrls) > 0 { c.cacheMutex.Lock() if c.cacheProtocol == nil { @@ -223,6 +234,7 @@ func (c *ServiceConfig) Export() error { } c.exporters = append(c.exporters, exporter) } + publishServiceDefinition(ivkURL) } c.exported.Store(true) return nil @@ -302,7 +314,10 @@ func (c *ServiceConfig) getUrlMap() url.Values { // auth filter urlMap.Set(constant.SERVICE_AUTH_KEY, c.Auth) - urlMap.Set(constant.PARAMTER_SIGNATURE_ENABLE_KEY, c.ParamSign) + urlMap.Set(constant.PARAMETER_SIGNATURE_ENABLE_KEY, c.ParamSign) + + // whether to export or not + urlMap.Set(constant.EXPORT_KEY, strconv.FormatBool(c.export)) for _, v := range c.Methods { prefix := "methods." + v.Name + "." @@ -332,3 +347,16 @@ func (c *ServiceConfig) GetExportedUrls() []*common.URL { } return nil } + +func publishServiceDefinition(url *common.URL) { + if remoteMetadataService, err := extension.GetRemoteMetadataService(); err == nil && remoteMetadataService != nil { + remoteMetadataService.PublishServiceDefinition(url) + } +} + +// postProcessConfig asks registered ConfigPostProcessor to post-process the current ServiceConfig. +func (c *ServiceConfig) postProcessConfig(url *common.URL) { + for _, p := range extension.GetConfigPostProcessors() { + p.PostProcessServiceConfig(url) + } +} diff --git a/config/service_config_test.go b/config/service_config_test.go index 61c8864b6ab7eb146a92e76187cd6363bbdb8dc8..aea0bde7a25d14bb720af0b83f06f44bdd6806c9 100644 --- a/config/service_config_test.go +++ b/config/service_config_test.go @@ -176,7 +176,8 @@ func TestExport(t *testing.T) { service := providerConfig.Services[i] service.Implement(&MockService{}) service.Protocols = providerConfig.Protocols - service.Export() + err := service.Export() + assert.Nil(t, err) } providerConfig = nil } diff --git a/config_center/apollo/impl.go b/config_center/apollo/impl.go index c69fc2f66b23cd877b447fc78084fb9197c253aa..5b74f5e15013c07de000cc18cab98238b96ac060 100644 --- a/config_center/apollo/impl.go +++ b/config_center/apollo/impl.go @@ -146,9 +146,8 @@ func (c *apolloConfiguration) getAddressWithProtocolPrefix(url *common.URL) stri address := url.Location converted := address if len(address) != 0 { - reg := regexp.MustCompile("\\s+") - address = reg.ReplaceAllString(address, "") - parts := strings.Split(address, ",") + addr := regexp.MustCompile(`\s+`).ReplaceAllString(address, "") + parts := strings.Split(addr, ",") addrs := make([]string, 0) for _, part := range parts { addr := part diff --git a/config_center/apollo/impl_test.go b/config_center/apollo/impl_test.go index 4720775c285f84bd4fe2146240feea87c8a20817..3b2cb168402534c1a8071e644827a0f948282f75 100644 --- a/config_center/apollo/impl_test.go +++ b/config_center/apollo/impl_test.go @@ -126,24 +126,24 @@ func initApollo() *httptest.Server { } func configResponse(rw http.ResponseWriter, _ *http.Request) { - result := fmt.Sprintf(mockConfigRes) + result := mockConfigRes fmt.Fprintf(rw, "%s", result) } func notifyResponse(rw http.ResponseWriter, req *http.Request) { - result := fmt.Sprintf(mockNotifyRes) + result := mockNotifyRes fmt.Fprintf(rw, "%s", result) } func serviceConfigResponse(rw http.ResponseWriter, _ *http.Request) { - result := fmt.Sprintf(mockServiceConfigRes) + result := mockServiceConfigRes fmt.Fprintf(rw, "%s", result) } // run mock config server func runMockConfigServer(handlerMap map[string]func(http.ResponseWriter, *http.Request), notifyHandler func(http.ResponseWriter, *http.Request)) *httptest.Server { - uriHandlerMap := make(map[string]func(http.ResponseWriter, *http.Request), 0) + uriHandlerMap := make(map[string]func(http.ResponseWriter, *http.Request)) for namespace, handler := range handlerMap { uri := fmt.Sprintf("/configs/%s/%s/%s", mockAppId, mockCluster, namespace) uriHandlerMap[uri] = handler @@ -227,7 +227,7 @@ func TestListener(t *testing.T) { apollo.listeners.Range(func(_, value interface{}) bool { apolloListener := value.(*apolloListener) for e := range apolloListener.listeners { - fmt.Println(e) + t.Logf("listener:%v", e) listenerCount++ } return true diff --git a/config_center/apollo/listener.go b/config_center/apollo/listener.go index ace5ed026875d2478e5d81b1974a6c60f856378c..44d325582f3b04871aaadc5b39cbc17ab7a0eeea 100644 --- a/config_center/apollo/listener.go +++ b/config_center/apollo/listener.go @@ -36,7 +36,7 @@ type apolloListener struct { // nolint func newApolloListener() *apolloListener { return &apolloListener{ - listeners: make(map[config_center.ConfigurationListener]struct{}, 0), + listeners: make(map[config_center.ConfigurationListener]struct{}), } } diff --git a/config_center/file/impl.go b/config_center/file/impl.go index f29a33d5e2519b54a5496f5ea03ff170020bb28c..6489a073deff643ad7eecc7f3c26ef0b8899ac53 100644 --- a/config_center/file/impl.go +++ b/config_center/file/impl.go @@ -24,7 +24,6 @@ import ( "os" "os/exec" "os/user" - "path" "path/filepath" "runtime" "strings" @@ -41,11 +40,19 @@ import ( "github.com/apache/dubbo-go/config_center/parser" ) +var ( + osType = runtime.GOOS +) + +const ( + windowsOS = "windows" +) + const ( - PARAM_NAME_PREFIX = "dubbo.config-center." - CONFIG_CENTER_DIR_PARAM_NAME = PARAM_NAME_PREFIX + "dir" - CONFIG_CENTER_ENCODING_PARAM_NAME = PARAM_NAME_PREFIX + "encoding" - DEFAULT_CONFIG_CENTER_ENCODING = "UTF-8" + ParamNamePrefix = "dubbo.config-center." + ConfigCenterDirParamName = ParamNamePrefix + "dir" + ConfigCenterEncodingParamName = ParamNamePrefix + "encoding" + defaultConfigCenterEncoding = "UTF-8" ) // FileSystemDynamicConfiguration @@ -59,24 +66,14 @@ type FileSystemDynamicConfiguration struct { } func newFileSystemDynamicConfiguration(url *common.URL) (*FileSystemDynamicConfiguration, error) { - encode := url.GetParam(CONFIG_CENTER_ENCODING_PARAM_NAME, DEFAULT_CONFIG_CENTER_ENCODING) + encode := url.GetParam(ConfigCenterEncodingParamName, defaultConfigCenterEncoding) - root := url.GetParam(CONFIG_CENTER_DIR_PARAM_NAME, "") + root := url.GetParam(ConfigCenterDirParamName, "") var c *FileSystemDynamicConfiguration - if _, err := os.Stat(root); err != nil { - // not exist, use default, /XXX/xx/.dubbo/config-center - if rp, err := Home(); err != nil { - return nil, perrors.WithStack(err) - } else { - root = path.Join(rp, ".dubbo", "config-center") - } - } - if _, err := os.Stat(root); err != nil { - // it must be dir, if not exist, will create - if err = createDir(root); err != nil { - return nil, perrors.WithStack(err) - } + root, err := mkdirIfNecessary(root) + if err != nil { + return nil, err } c = &FileSystemDynamicConfiguration{ @@ -180,7 +177,7 @@ func (fsdc *FileSystemDynamicConfiguration) GetConfigKeysByGroup(group string) ( return r, nil } -// RemoveConfig will remove the config whit hte (key, group) +// RemoveConfig will remove tconfig_center/nacos/impl_testhe config whit hte (key, group) func (fsdc *FileSystemDynamicConfiguration) RemoveConfig(key string, group string) error { tmpPath := fsdc.GetPath(key, group) _, err := fsdc.deleteDelay(tmpPath) @@ -195,18 +192,18 @@ func (fsdc *FileSystemDynamicConfiguration) Close() error { // GetPath get path func (fsdc *FileSystemDynamicConfiguration) GetPath(key string, group string) string { if len(key) == 0 { - return path.Join(fsdc.rootPath, group) + return filepath.Join(fsdc.rootPath, group) } if len(group) == 0 { group = config_center.DEFAULT_GROUP } - return path.Join(fsdc.rootPath, group, key) + return filepath.Join(fsdc.rootPath, group, adapterKey(key)) } func (fsdc *FileSystemDynamicConfiguration) deleteDelay(path string) (bool, error) { - if path == "" { + if len(path) == 0 { return false, nil } @@ -226,9 +223,7 @@ func (fsdc *FileSystemDynamicConfiguration) write2File(fp string, value string) } func forceMkdirParent(fp string) error { - pd := getParentDirectory(fp) - - return createDir(pd) + return createDir(getParentDirectory(fp)) } func createDir(path string) error { @@ -250,6 +245,7 @@ func substr(s string, pos, length int) string { if l > len(runes) { l = len(runes) } + return string(runes[pos:l]) } @@ -264,7 +260,7 @@ func Home() (string, error) { } // cross compile support - if "windows" == runtime.GOOS { + if windowsOS == osType { return homeWindows() } @@ -287,7 +283,7 @@ func homeUnix() (string, error) { } result := strings.TrimSpace(stdout.String()) - if result == "" { + if len(result) == 0 { return "", errors.New("blank output when reading home directory") } @@ -298,12 +294,66 @@ func homeWindows() (string, error) { drive := os.Getenv("HOMEDRIVE") homePath := os.Getenv("HOMEPATH") home := drive + homePath - if drive == "" || homePath == "" { + if len(drive) == 0 || len(homePath) == 0 { home = os.Getenv("USERPROFILE") } - if home == "" { + if len(home) == 0 { return "", errors.New("HOMEDRIVE, HOMEPATH, and USERPROFILE are blank") } return home, nil } + +func mkdirIfNecessary(urlRoot string) (string, error) { + if !legalPath(urlRoot) { + // not exist, use default, mac is: /XXX/xx/.dubbo/config-center + rp, err := Home() + if err != nil { + return "", perrors.WithStack(err) + } + + urlRoot = adapterUrl(rp) + } + + if _, err := os.Stat(urlRoot); err != nil { + // it must be dir, if not exist, will create + if err = createDir(urlRoot); err != nil { + return "", perrors.WithStack(err) + } + } + + return urlRoot, nil +} + +func legalPath(path string) bool { + if len(path) == 0 { + return false + } + if _, err := os.Stat(path); err != nil { + return false + } + + return true +} + +func adapterUrl(rp string) string { + if osType == windowsOS { + return filepath.Join(rp, "_dubbo", "config-center") + } + + return filepath.Join(rp, ".dubbo", "config-center") +} + +// used for GetPath. param key default is instance's id. +// e.g: (ip:port) 127.0.0.1:20081, in windows env, will change to 127_0_0_1_20081 +func adapterKey(key string) string { + if len(key) == 0 { + return "" + } + + if osType == windowsOS { + return strings.ReplaceAll(strings.ReplaceAll(key, ".", "_"), ":", "_") + } + + return key +} diff --git a/config_center/file/impl_test.go b/config_center/file/impl_test.go index e912cb7078fe42b514ba510db6b7f871ab998ea9..556b6a3d7aa168a83b0861936ad1dc54f827eb18 100644 --- a/config_center/file/impl_test.go +++ b/config_center/file/impl_test.go @@ -63,6 +63,7 @@ func TestPublishAndGetConfig(t *testing.T) { func TestAddListener(t *testing.T) { file, err := initFileData(t) + assert.Nil(t, err) group := "dubbogo" value := "Test Value" err = file.PublishConfig(key, group, value) @@ -81,6 +82,7 @@ func TestAddListener(t *testing.T) { func TestRemoveListener(t *testing.T) { file, err := initFileData(t) + assert.NoError(t, err) group := "dubbogo" value := "Test Value" err = file.PublishConfig(key, group, value) @@ -106,9 +108,11 @@ func TestRemoveListener(t *testing.T) { func TestGetConfigKeysByGroup(t *testing.T) { file, err := initFileData(t) + assert.Nil(t, err) group := "dubbogo" value := "Test Value" err = file.PublishConfig(key, group, value) + assert.NoError(t, err) gs, err := file.GetConfigKeysByGroup(group) assert.NoError(t, err) assert.Equal(t, 1, gs.Size()) diff --git a/config_center/nacos/client.go b/config_center/nacos/client.go index f3942c023d6bc7b7c7afe09863283cbc315fdb1f..1e96b36a4f19b8548d2ffc9818251ebfa96f365b 100644 --- a/config_center/nacos/client.go +++ b/config_center/nacos/client.go @@ -18,7 +18,6 @@ package nacos import ( - "path/filepath" "strconv" "strings" "sync" @@ -38,9 +37,6 @@ import ( "github.com/apache/dubbo-go/common/logger" ) -// Nacos Log dir, it can be override when creating client by config_center.log_dir -var logDir = filepath.Join("logs", "nacos", "log") - // NacosClient Nacos client type NacosClient struct { name string @@ -69,7 +65,7 @@ type option func(*options) type options struct { nacosName string - client *NacosClient + //client *NacosClient } // WithNacosName Set nacos name diff --git a/config_center/nacos/impl_test.go b/config_center/nacos/impl_test.go index 40efa5f4f288d0eff6d9648481cb2a14bfdb3931..b7bd94bf96bfdafed1591e58f338fa23a0b96a6f 100644 --- a/config_center/nacos/impl_test.go +++ b/config_center/nacos/impl_test.go @@ -40,7 +40,7 @@ import ( // run mock config server func runMockConfigServer(configHandler func(http.ResponseWriter, *http.Request), configListenHandler func(http.ResponseWriter, *http.Request)) *httptest.Server { - uriHandlerMap := make(map[string]func(http.ResponseWriter, *http.Request), 0) + uriHandlerMap := make(map[string]func(http.ResponseWriter, *http.Request)) uriHandlerMap["/nacos/v1/cs/configs"] = configHandler uriHandlerMap["/nacos/v1/cs/configs/listener"] = configListenHandler @@ -85,6 +85,8 @@ func TestGetConfig(t *testing.T) { nacos, err := initNacosData(t) assert.NoError(t, err) configs, err := nacos.GetProperties("dubbo.properties", config_center.WithGroup("dubbo")) + assert.Empty(t, configs) + assert.NoError(t, err) _, err = nacos.Parser().Parse(configs) assert.NoError(t, err) } @@ -100,7 +102,8 @@ func TestNacosDynamicConfiguration_GetConfigKeysByGroup(t *testing.T) { } ` ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(data)) + _, err := w.Write([]byte(data)) + assert.Nil(t, err) })) nacosURL := strings.ReplaceAll(ts.URL, "http", "registry") diff --git a/config_center/nacos/listener.go b/config_center/nacos/listener.go index 57df0363a1d7712e1e02a66595030c207b19c170..b0607e29b4d4d3d5caf9ee7072d9c2e44088738a 100644 --- a/config_center/nacos/listener.go +++ b/config_center/nacos/listener.go @@ -38,7 +38,6 @@ func callback(listener config_center.ConfigurationListener, _, _, dataId, data s func (n *nacosDynamicConfiguration) addListener(key string, listener config_center.ConfigurationListener) { _, loaded := n.keyListeners.Load(key) if !loaded { - _, cancel := context.WithCancel(context.Background()) err := (*n.client.Client()).ListenConfig(vo.ConfigParam{ DataId: key, Group: "dubbo", @@ -50,13 +49,15 @@ func (n *nacosDynamicConfiguration) addListener(key string, listener config_cent logger.Errorf("nacos : listen config fail, error:%v ", err) return } + _, cancel := context.WithCancel(context.Background()) newListener := make(map[config_center.ConfigurationListener]context.CancelFunc) newListener[listener] = cancel n.keyListeners.Store(key, newListener) - } else { - // TODO check goroutine alive, but this version of go_nacos_sdk is not support. - logger.Infof("profile:%s. this profile is already listening", key) + return } + + // TODO check goroutine alive, but this version of go_nacos_sdk is not support. + logger.Infof("profile:%s. this profile is already listening", key) } func (n *nacosDynamicConfiguration) removeListener(key string, listener config_center.ConfigurationListener) { diff --git a/config_center/zookeeper/impl.go b/config_center/zookeeper/impl.go index 17812e917f533d28c052c7cda3411de44b9aa7b5..f3b2235025c033cd125c9a87b2c277a5a3d70243 100644 --- a/config_center/zookeeper/impl.go +++ b/config_center/zookeeper/impl.go @@ -52,7 +52,7 @@ type zookeeperDynamicConfiguration struct { done chan struct{} client *zookeeper.ZookeeperClient - listenerLock sync.Mutex + //listenerLock sync.Mutex listener *zookeeper.ZkEventListener cacheListener *CacheListener parser parser.ConfigurationParser diff --git a/config_center/zookeeper/impl_test.go b/config_center/zookeeper/impl_test.go index d4a9de41fd62d48ce4528056289839a38285c9a3..a518bb6ec05d01aa953173c9c98aef69ae31348b 100644 --- a/config_center/zookeeper/impl_test.go +++ b/config_center/zookeeper/impl_test.go @@ -99,7 +99,10 @@ func initZkData(group string, t *testing.T) (*zk.TestCluster, *zookeeperDynamicC func TestGetConfig(t *testing.T) { ts, reg := initZkData("dubbo", t) - defer ts.Stop() + defer func() { + err := ts.Stop() + assert.NoError(t, err) + }() configs, err := reg.GetProperties(dubboPropertyFileName, config_center.WithGroup("dubbo")) assert.NoError(t, err) m, err := reg.Parser().Parse(configs) @@ -107,15 +110,21 @@ func TestGetConfig(t *testing.T) { assert.Equal(t, "5s", m["dubbo.consumer.request_timeout"]) configs, err = reg.GetProperties(dubboPropertyFileName) assert.Error(t, err) + assert.Equal(t, "", configs) configs, err = reg.GetInternalProperty(dubboPropertyFileName) assert.Error(t, err) + assert.Equal(t, "", configs) configs, err = reg.GetRule(dubboPropertyFileName) assert.Error(t, err) + assert.Equal(t, "", configs) } func TestAddListener(t *testing.T) { ts, reg := initZkData("", t) - defer ts.Stop() + defer func() { + err := ts.Stop() + assert.NoError(t, err) + }() listener := &mockDataListener{} reg.AddListener(dubboPropertyFileName, listener) listener.wg.Add(1) @@ -148,7 +157,10 @@ func TestAddListener(t *testing.T) { func TestRemoveListener(t *testing.T) { ts, reg := initZkData("", t) - defer ts.Stop() + defer func() { + err := ts.Stop() + assert.NoError(t, err) + }() listener := &mockDataListener{} reg.AddListener(dubboPropertyFileName, listener) listener.wg.Add(1) @@ -186,7 +198,10 @@ func TestZookeeperDynamicConfigurationPublishConfig(t *testing.T) { customGroup := "Custom Group" key := "myKey" ts, zk := initZkData(config_center.DEFAULT_GROUP, t) - defer ts.Stop() + defer func() { + err := ts.Stop() + assert.NoError(t, err) + }() err := zk.PublishConfig(key, customGroup, value) assert.Nil(t, err) result, err := zk.GetInternalProperty("myKey", config_center.WithGroup(customGroup)) diff --git a/doc/pic/misc/dubbogo-dingding.png b/doc/pic/misc/dubbogo-dingding.png new file mode 100644 index 0000000000000000000000000000000000000000..dc27d4ecce94a095e2eb70f97446c76c5b8537da Binary files /dev/null and b/doc/pic/misc/dubbogo-dingding.png differ diff --git a/filter/access_key.go b/filter/access_key.go index 4801d64fe46461424c5dac5aef2eebc719ee19c4..f38764bcea9fd1fc2dd5b0e7028aaf21a2c92c92 100644 --- a/filter/access_key.go +++ b/filter/access_key.go @@ -26,7 +26,7 @@ import ( type AccessKeyPair struct { AccessKey string `yaml:"accessKey" json:"accessKey,omitempty" property:"accessKey"` SecretKey string `yaml:"secretKey" json:"secretKey,omitempty" property:"secretKey"` - ConsumerSide string `yaml:"consumerSide" json:"ConsumerSide,consumerSide" property:"consumerSide"` + ConsumerSide string `yaml:"consumerSide" json:"consumerSide,omitempty" property:"consumerSide"` ProviderSide string `yaml:"providerSide" json:"providerSide,omitempty" property:"providerSide"` Creator string `yaml:"creator" json:"creator,omitempty" property:"creator"` Options string `yaml:"options" json:"options,omitempty" property:"options"` diff --git a/filter/filter.go b/filter/filter.go index 804bf3b9df8040c6377648f150c25d421b29b93d..f17c1a231e53e9a3df48072c851cbb26b42a04b4 100644 --- a/filter/filter.go +++ b/filter/filter.go @@ -20,6 +20,7 @@ package filter import ( "context" ) + import ( "github.com/apache/dubbo-go/protocol" ) diff --git a/filter/filter_impl/access_log_filter_test.go b/filter/filter_impl/access_log_filter_test.go index a3a6151aa1b6a933c57543248f3703125fa356d9..9c4b947db4adbe0a9490f4b13964632028469d18 100644 --- a/filter/filter_impl/access_log_filter_test.go +++ b/filter/filter_impl/access_log_filter_test.go @@ -77,6 +77,6 @@ func TestAccessLogFilterInvokeDefaultConfig(t *testing.T) { func TestAccessLogFilterOnResponse(t *testing.T) { result := &protocol.RPCResult{} accessLogFilter := GetAccessLogFilter() - response := accessLogFilter.OnResponse(nil, result, nil, nil) + response := accessLogFilter.OnResponse(context.TODO(), result, nil, nil) assert.Equal(t, result, response) } diff --git a/filter/filter_impl/active_filter_test.go b/filter/filter_impl/active_filter_test.go index 9837a49c72e28c7a7209f8af6059bdc30c222cc2..2397503dc8f46381a131bed6f924d465a71a9193 100644 --- a/filter/filter_impl/active_filter_test.go +++ b/filter/filter_impl/active_filter_test.go @@ -37,7 +37,7 @@ import ( ) func TestActiveFilterInvoke(t *testing.T) { - invoc := invocation.NewRPCInvocation("test", []interface{}{"OK"}, make(map[string]interface{}, 0)) + invoc := invocation.NewRPCInvocation("test", []interface{}{"OK"}, make(map[string]interface{})) url, _ := common.NewURL("dubbo://192.168.10.10:20000/com.ikurento.user.UserProvider") filter := ActiveFilter{} ctrl := gomock.NewController(t) @@ -65,7 +65,7 @@ func TestActiveFilterOnResponse(t *testing.T) { result := &protocol.RPCResult{ Err: errors.New("test"), } - filter.OnResponse(nil, result, invoker, invoc) + filter.OnResponse(context.TODO(), result, invoker, invoc) methodStatus := protocol.GetMethodStatus(url, "test") urlStatus := protocol.GetURLStatus(url) diff --git a/filter/filter_impl/auth/default_authenticator.go b/filter/filter_impl/auth/default_authenticator.go index 5b86fc148e42b6364bcb0752c31bfbbc3cfa2b9d..7c7131c9cf1a4abba7b2ec1b4282b49b15f3c8b9 100644 --- a/filter/filter_impl/auth/default_authenticator.go +++ b/filter/filter_impl/auth/default_authenticator.go @@ -69,7 +69,7 @@ func getSignature(url *common.URL, invocation protocol.Invocation, secrectKey st requestString := fmt.Sprintf(constant.SIGNATURE_STRING_FORMAT, url.ColonSeparatedKey(), invocation.MethodName(), secrectKey, currentTime) var signature string - if parameterEncrypt := url.GetParamBool(constant.PARAMTER_SIGNATURE_ENABLE_KEY, false); parameterEncrypt { + if parameterEncrypt := url.GetParamBool(constant.PARAMETER_SIGNATURE_ENABLE_KEY, false); parameterEncrypt { var err error if signature, err = SignWithParams(invocation.Arguments(), requestString, secrectKey); err != nil { // TODO diff --git a/filter/filter_impl/auth/default_authenticator_test.go b/filter/filter_impl/auth/default_authenticator_test.go index 37c7e9d1837a183e72db1134506cc3f89611ac76..d915b6a16ee5ccd15a390059d74e108bdf4c2bce 100644 --- a/filter/filter_impl/auth/default_authenticator_test.go +++ b/filter/filter_impl/auth/default_authenticator_test.go @@ -39,7 +39,7 @@ func TestDefaultAuthenticator_Authenticate(t *testing.T) { secret := "dubbo-sk" access := "dubbo-ak" testurl, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?interface=com.ikurento.user.UserProvider&group=gg&version=2.6.0") - testurl.SetParam(constant.PARAMTER_SIGNATURE_ENABLE_KEY, "true") + testurl.SetParam(constant.PARAMETER_SIGNATURE_ENABLE_KEY, "true") testurl.SetParam(constant.ACCESS_KEY_ID_KEY, access) testurl.SetParam(constant.SECRET_ACCESS_KEY_KEY, secret) parmas := []interface{}{"OK", struct { @@ -77,7 +77,7 @@ func TestDefaultAuthenticator_Sign(t *testing.T) { testurl, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?application=test&interface=com.ikurento.user.UserProvider&group=gg&version=2.6.0") testurl.SetParam(constant.ACCESS_KEY_ID_KEY, "akey") testurl.SetParam(constant.SECRET_ACCESS_KEY_KEY, "skey") - testurl.SetParam(constant.PARAMTER_SIGNATURE_ENABLE_KEY, "false") + testurl.SetParam(constant.PARAMETER_SIGNATURE_ENABLE_KEY, "false") inv := invocation.NewRPCInvocation("test", []interface{}{"OK"}, nil) _ = authenticator.Sign(inv, testurl) assert.NotEqual(t, inv.AttachmentsByKey(constant.REQUEST_SIGNATURE_KEY, ""), "") @@ -113,12 +113,13 @@ func Test_getAccessKeyPairFailed(t *testing.T) { common.WithParamsValue(constant.SECRET_ACCESS_KEY_KEY, "skey"), common.WithParamsValue(constant.ACCESS_KEY_ID_KEY, "akey"), common.WithParamsValue(constant.ACCESS_KEY_STORAGE_KEY, "dubbo")) _, e = getAccessKeyPair(invcation, testurl) + assert.NoError(t, e) } func Test_getSignatureWithinParams(t *testing.T) { testurl, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?interface=com.ikurento.user.UserProvider&group=gg&version=2.6.0") - testurl.SetParam(constant.PARAMTER_SIGNATURE_ENABLE_KEY, "true") + testurl.SetParam(constant.PARAMETER_SIGNATURE_ENABLE_KEY, "true") inv := invocation.NewRPCInvocation("test", []interface{}{"OK"}, map[string]interface{}{ "": "", }) @@ -134,7 +135,7 @@ func Test_getSignatureWithinParams(t *testing.T) { func Test_getSignature(t *testing.T) { testurl, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?interface=com.ikurento.user.UserProvider&group=gg&version=2.6.0") - testurl.SetParam(constant.PARAMTER_SIGNATURE_ENABLE_KEY, "false") + testurl.SetParam(constant.PARAMETER_SIGNATURE_ENABLE_KEY, "false") inv := invocation.NewRPCInvocation("test", []interface{}{"OK"}, nil) secret := "dubbo" current := strconv.Itoa(int(time.Now().Unix() * 1000)) diff --git a/filter/filter_impl/auth/sign_util.go b/filter/filter_impl/auth/sign_util.go index 45170bb8117284275a87a3a57d14ce68d6cc4e9c..4c12c762ed6715af551f6e37c251cf095bb43dc4 100644 --- a/filter/filter_impl/auth/sign_util.go +++ b/filter/filter_impl/auth/sign_util.go @@ -26,6 +26,10 @@ import ( "strings" ) +import ( + "github.com/apache/dubbo-go/common/logger" +) + // Sign gets a signature string with given bytes func Sign(metadata, key string) string { return doSign([]byte(metadata), key) @@ -33,7 +37,7 @@ func Sign(metadata, key string) string { // SignWithParams returns a signature with giving params and metadata. func SignWithParams(params []interface{}, metadata, key string) (string, error) { - if params == nil || len(params) == 0 { + if len(params) == 0 { return Sign(metadata, key), nil } @@ -56,7 +60,9 @@ func toBytes(data []interface{}) ([]byte, error) { func doSign(bytes []byte, key string) string { mac := hmac.New(sha256.New, []byte(key)) - mac.Write(bytes) + if _, err := mac.Write(bytes); err != nil { + logger.Error(err) + } signature := mac.Sum(nil) return base64.URLEncoding.EncodeToString(signature) } diff --git a/filter/filter_impl/execute_limit_filter.go b/filter/filter_impl/execute_limit_filter.go index 5fc309cfb49fbeef5e933a84c1b80654087da701..35611611c8a716c3799d85e4c31fd3440b3611ef 100644 --- a/filter/filter_impl/execute_limit_filter.go +++ b/filter/filter_impl/execute_limit_filter.go @@ -84,7 +84,7 @@ func (ef *ExecuteLimitFilter) Invoke(ctx context.Context, invoker protocol.Invok methodConfigPrefix := "methods." + invocation.MethodName() + "." ivkURL := invoker.GetUrl() limitTarget := ivkURL.ServiceKey() - limitRateConfig := constant.DEFAULT_EXECUTE_LIMIT + var limitRateConfig string methodLevelConfig := ivkURL.GetParam(methodConfigPrefix+constant.EXECUTE_LIMIT_KEY, "") if len(methodLevelConfig) > 0 { diff --git a/filter/filter_impl/execute_limit_filter_test.go b/filter/filter_impl/execute_limit_filter_test.go index 2aebcaa8fa62278da3092d6359d2a01571be37d0..682f8fa8b475348624a33d44d9a08190fe270fa8 100644 --- a/filter/filter_impl/execute_limit_filter_test.go +++ b/filter/filter_impl/execute_limit_filter_test.go @@ -36,7 +36,7 @@ import ( func TestExecuteLimitFilterInvokeIgnored(t *testing.T) { methodName := "hello" - invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{}, 0)) + invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{})) invokeUrl := common.NewURLWithOptions( common.WithParams(url.Values{}), @@ -51,7 +51,7 @@ func TestExecuteLimitFilterInvokeIgnored(t *testing.T) { func TestExecuteLimitFilterInvokeConfigureError(t *testing.T) { methodName := "hello1" - invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{}, 0)) + invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{})) invokeUrl := common.NewURLWithOptions( common.WithParams(url.Values{}), @@ -68,7 +68,7 @@ func TestExecuteLimitFilterInvokeConfigureError(t *testing.T) { func TestExecuteLimitFilterInvoke(t *testing.T) { methodName := "hello1" - invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{}, 0)) + invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{})) invokeUrl := common.NewURLWithOptions( common.WithParams(url.Values{}), diff --git a/filter/filter_impl/generic_service_filter_test.go b/filter/filter_impl/generic_service_filter_test.go index 8b2fb549c299bb6c1cf65c4254ba6784caec5655..c755a2d28080e8c6a56e742181b944d299e493ed 100644 --- a/filter/filter_impl/generic_service_filter_test.go +++ b/filter/filter_impl/generic_service_filter_test.go @@ -125,7 +125,7 @@ func TestGenericServiceFilterResponseTestStruct(t *testing.T) { filter := GetGenericServiceFilter() methodName := "$invoke" rpcInvocation := invocation.NewRPCInvocation(methodName, aurguments, nil) - r := filter.OnResponse(nil, result, nil, rpcInvocation) + r := filter.OnResponse(context.TODO(), result, nil, rpcInvocation) assert.NotNil(t, r.Result()) assert.Equal(t, reflect.ValueOf(r.Result()).Kind(), reflect.Map) } @@ -143,7 +143,7 @@ func TestGenericServiceFilterResponseString(t *testing.T) { filter := GetGenericServiceFilter() methodName := "$invoke" rpcInvocation := invocation.NewRPCInvocation(methodName, aurguments, nil) - r := filter.OnResponse(nil, result, nil, rpcInvocation) + r := filter.OnResponse(context.TODO(), result, nil, rpcInvocation) assert.NotNil(t, r.Result()) assert.Equal(t, reflect.ValueOf(r.Result()).Kind(), reflect.String) } diff --git a/filter/filter_impl/graceful_shutdown_filter_test.go b/filter/filter_impl/graceful_shutdown_filter_test.go index 447a557ad5f508bf444ccae5dacb8a8559c933ea..b16956e01c85b52ec0009f96998a72e2a4314911 100644 --- a/filter/filter_impl/graceful_shutdown_filter_test.go +++ b/filter/filter_impl/graceful_shutdown_filter_test.go @@ -39,10 +39,8 @@ import ( ) func TestGenericFilterInvoke(t *testing.T) { - invoc := invocation.NewRPCInvocation("GetUser", []interface{}{"OK"}, make(map[string]interface{}, 0)) - - invokeUrl := common.NewURLWithOptions( - common.WithParams(url.Values{})) + invoc := invocation.NewRPCInvocation("GetUser", []interface{}{"OK"}, make(map[string]interface{})) + invokeUrl := common.NewURLWithOptions(common.WithParams(url.Values{})) shutdownFilter := extension.GetFilter(constant.PROVIDER_SHUTDOWN_FILTER).(*gracefulShutdownFilter) @@ -65,7 +63,8 @@ func TestGenericFilterInvoke(t *testing.T) { shutdownFilter.shutdownConfig = providerConfig.ShutdownConfig assert.True(t, shutdownFilter.rejectNewRequest()) - result = shutdownFilter.OnResponse(nil, nil, protocol.NewBaseInvoker(invokeUrl), invoc) + result = shutdownFilter.OnResponse(context.Background(), nil, protocol.NewBaseInvoker(invokeUrl), invoc) + assert.Nil(t, result) rejectHandler := &common2.OnlyLogRejectedExecutionHandler{} extension.SetRejectedExecutionHandler("mock", func() filter.RejectedExecutionHandler { diff --git a/filter/filter_impl/seata_filter.go b/filter/filter_impl/seata_filter.go index 7722d2954f905ece4a1b48628c31c06debf45614..b7b7b0e94b4633dda10278e9674566a82701b7f6 100644 --- a/filter/filter_impl/seata_filter.go +++ b/filter/filter_impl/seata_filter.go @@ -23,6 +23,7 @@ import ( ) import ( + "github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/common/extension" "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/filter" @@ -30,12 +31,12 @@ import ( ) const ( - SEATA = "seata" - SEATA_XID = "SEATA_XID" + SEATA = constant.DubboCtxKey("seata") + SEATA_XID = constant.DubboCtxKey("SEATA_XID") ) func init() { - extension.SetFilter(SEATA, getSeataFilter) + extension.SetFilter(string(SEATA), getSeataFilter) } // SeataFilter when use seata-golang, use this filter to transfer xid @@ -45,7 +46,7 @@ type SeataFilter struct{} // Invoke Get Xid by attachment key `SEATA_XID` func (sf *SeataFilter) Invoke(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result { logger.Infof("invoking seata filter.") - xid := invocation.AttachmentsByKey(SEATA_XID, "") + xid := invocation.AttachmentsByKey(string(SEATA_XID), "") if strings.TrimSpace(xid) != "" { logger.Debugf("Method: %v,Xid: %v", invocation.MethodName(), xid) return invoker.Invoke(context.WithValue(ctx, SEATA_XID, xid), invocation) diff --git a/filter/filter_impl/seata_filter_test.go b/filter/filter_impl/seata_filter_test.go index 45817e95cbd2eaa7365adc8a299523af8310f797..1705eba787f5569064841d6a713ed2f2e428314c 100644 --- a/filter/filter_impl/seata_filter_test.go +++ b/filter/filter_impl/seata_filter_test.go @@ -50,7 +50,7 @@ func TestSeataFilter_Invoke(t *testing.T) { filter := getSeataFilter() result := filter.Invoke(context.Background(), &testMockSeataInvoker{}, invocation.NewRPCInvocation("$echo", []interface{}{"OK"}, map[string]interface{}{ - SEATA_XID: "10.30.21.227:8091:2000047792", + string(SEATA_XID): "10.30.21.227:8091:2000047792", })) assert.Equal(t, "10.30.21.227:8091:2000047792", result.Result()) } diff --git a/filter/filter_impl/sentinel_filter.go b/filter/filter_impl/sentinel_filter.go index aec814d70a5f1dfc9e6688b9731f725f43443b93..1de27adbac1808dbbbf8017f0119077752191d6f 100644 --- a/filter/filter_impl/sentinel_filter.go +++ b/filter/filter_impl/sentinel_filter.go @@ -38,13 +38,15 @@ import ( "github.com/apache/dubbo-go/protocol" ) +// Integrate Sentinel Go MUST HAVE: +// 1. Must initialize Sentinel Go run environment, +// refer to https://github.com/alibaba/sentinel-golang/blob/master/api/init.go +// 2. Register rules for resources user want to guard + func init() { extension.SetFilter(SentinelProviderFilterName, GetSentinelProviderFilter) extension.SetFilter(SentinelConsumerFilterName, GetSentinelConsumerFilter) - if err := sentinel.InitDefault(); err != nil { - logger.Errorf("[Sentinel Filter] fail to initialize Sentinel") - } if err := logging.ResetGlobalLogger(DubboLoggerWrapper{Logger: logger.GetLogger()}); err != nil { logger.Errorf("[Sentinel Filter] fail to ingest dubbo logger into sentinel") } @@ -54,20 +56,36 @@ type DubboLoggerWrapper struct { logger.Logger } -func (d DubboLoggerWrapper) Fatal(v ...interface{}) { - d.Logger.Error(v...) +func (d DubboLoggerWrapper) Debug(msg string, keysAndValues ...interface{}) { + d.Logger.Debug(logging.AssembleMsg(logging.GlobalCallerDepth, "DEBUG", msg, nil, keysAndValues)) +} + +func (d DubboLoggerWrapper) DebugEnabled() bool { + return true +} + +func (d DubboLoggerWrapper) Info(msg string, keysAndValues ...interface{}) { + d.Logger.Info(logging.AssembleMsg(logging.GlobalCallerDepth, "INFO", msg, nil, keysAndValues)) } -func (d DubboLoggerWrapper) Fatalf(format string, v ...interface{}) { - d.Logger.Errorf(format, v...) +func (d DubboLoggerWrapper) InfoEnabled() bool { + return true +} + +func (d DubboLoggerWrapper) Warn(msg string, keysAndValues ...interface{}) { + d.Logger.Warn(logging.AssembleMsg(logging.GlobalCallerDepth, "WARN", msg, nil, keysAndValues)) } -func (d DubboLoggerWrapper) Panic(v ...interface{}) { - d.Logger.Error(v...) +func (d DubboLoggerWrapper) WarnEnabled() bool { + return true } -func (d DubboLoggerWrapper) Panicf(format string, v ...interface{}) { - d.Logger.Errorf(format, v...) +func (d DubboLoggerWrapper) Error(err error, msg string, keysAndValues ...interface{}) { + d.Logger.Warn(logging.AssembleMsg(logging.GlobalCallerDepth, "ERROR", msg, err, keysAndValues)) +} + +func (d DubboLoggerWrapper) ErrorEnabled() bool { + return true } func GetSentinelConsumerFilter() filter.Filter { @@ -187,8 +205,8 @@ const ( DefaultProviderPrefix = "dubbo:provider:" DefaultConsumerPrefix = "dubbo:consumer:" - MethodEntryKey = "$$sentinelMethodEntry" - InterfaceEntryKey = "$$sentinelInterfaceEntry" + MethodEntryKey = constant.DubboCtxKey("$$sentinelMethodEntry") + InterfaceEntryKey = constant.DubboCtxKey("$$sentinelInterfaceEntry") ) func getResourceName(invoker protocol.Invoker, invocation protocol.Invocation, prefix string) (interfaceResourceName, methodResourceName string) { diff --git a/filter/filter_impl/sentinel_filter_test.go b/filter/filter_impl/sentinel_filter_test.go index e8d481b40640bb09e9e60e922d4592603dea8f3a..c6b6d4280f08099ce3eef8bf1e5a3c37e9e67c59 100644 --- a/filter/filter_impl/sentinel_filter_test.go +++ b/filter/filter_impl/sentinel_filter_test.go @@ -50,11 +50,11 @@ func TestSentinelFilter_QPS(t *testing.T) { _, err = flow.LoadRules([]*flow.Rule{ { - Resource: interfaceResourceName, - MetricType: flow.QPS, + Resource: interfaceResourceName, + //MetricType: flow.QPS, TokenCalculateStrategy: flow.Direct, ControlBehavior: flow.Reject, - Count: 100, + Threshold: 100, RelationStrategy: flow.CurrentResource, }, }) diff --git a/filter/filter_impl/token_filter_test.go b/filter/filter_impl/token_filter_test.go index 9ef8c98d6868c3d545fe963ab13eb3f27bb88cd0..024ae2ae3142b1e193d6a24001f51f00badf537a 100644 --- a/filter/filter_impl/token_filter_test.go +++ b/filter/filter_impl/token_filter_test.go @@ -40,7 +40,7 @@ func TestTokenFilterInvoke(t *testing.T) { url := common.NewURLWithOptions( common.WithParams(url.Values{}), common.WithParamsValue(constant.TOKEN_KEY, "ori_key")) - attch := make(map[string]interface{}, 0) + attch := make(map[string]interface{}) attch[constant.TOKEN_KEY] = "ori_key" result := filter.Invoke(context.Background(), protocol.NewBaseInvoker(url), @@ -54,7 +54,7 @@ func TestTokenFilterInvokeEmptyToken(t *testing.T) { filter := GetTokenFilter() testUrl := common.URL{} - attch := make(map[string]interface{}, 0) + attch := make(map[string]interface{}) attch[constant.TOKEN_KEY] = "ori_key" result := filter.Invoke(context.Background(), protocol.NewBaseInvoker(&testUrl), invocation.NewRPCInvocation("MethodName", []interface{}{"OK"}, attch)) assert.Nil(t, result.Error()) @@ -67,7 +67,7 @@ func TestTokenFilterInvokeEmptyAttach(t *testing.T) { testUrl := common.NewURLWithOptions( common.WithParams(url.Values{}), common.WithParamsValue(constant.TOKEN_KEY, "ori_key")) - attch := make(map[string]interface{}, 0) + attch := make(map[string]interface{}) result := filter.Invoke(context.Background(), protocol.NewBaseInvoker(testUrl), invocation.NewRPCInvocation("MethodName", []interface{}{"OK"}, attch)) assert.NotNil(t, result.Error()) } @@ -78,7 +78,7 @@ func TestTokenFilterInvokeNotEqual(t *testing.T) { testUrl := common.NewURLWithOptions( common.WithParams(url.Values{}), common.WithParamsValue(constant.TOKEN_KEY, "ori_key")) - attch := make(map[string]interface{}, 0) + attch := make(map[string]interface{}) attch[constant.TOKEN_KEY] = "err_key" result := filter.Invoke(context.Background(), protocol.NewBaseInvoker(testUrl), invocation.NewRPCInvocation("MethodName", []interface{}{"OK"}, attch)) diff --git a/filter/filter_impl/tps/tps_limit_sliding_window_strategy.go b/filter/filter_impl/tps/tps_limit_sliding_window_strategy.go index cbbba19fff65be222cb895dcbe9b2e4d02082985..bc78f6471bda2c87d9e82eccdf73700547454340 100644 --- a/filter/filter_impl/tps/tps_limit_sliding_window_strategy.go +++ b/filter/filter_impl/tps/tps_limit_sliding_window_strategy.go @@ -54,7 +54,7 @@ type SlidingWindowTpsLimitStrategyImpl struct { queue *list.List } -// IsAllowable determins whether the number of requests within the time window overs the threshold +// IsAllowable determines whether the number of requests within the time window overs the threshold // It is thread-safe. func (impl *SlidingWindowTpsLimitStrategyImpl) IsAllowable() bool { impl.mutex.Lock() diff --git a/filter/filter_impl/tps/tps_limiter_method_service_test.go b/filter/filter_impl/tps/tps_limiter_method_service_test.go index e886647eefbbad102e340819f96456fcfedaae02..5baa70a5bc4eebe162243a485521543802a51f2c 100644 --- a/filter/filter_impl/tps/tps_limiter_method_service_test.go +++ b/filter/filter_impl/tps/tps_limiter_method_service_test.go @@ -36,7 +36,7 @@ import ( func TestMethodServiceTpsLimiterImplIsAllowableOnlyServiceLevel(t *testing.T) { methodName := "hello" - invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{}, 0)) + invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{})) ctrl := gomock.NewController(t) defer ctrl.Finish() @@ -63,7 +63,7 @@ func TestMethodServiceTpsLimiterImplIsAllowableOnlyServiceLevel(t *testing.T) { func TestMethodServiceTpsLimiterImplIsAllowableNoConfig(t *testing.T) { methodName := "hello1" - invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{}, 0)) + invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{})) // ctrl := gomock.NewController(t) // defer ctrl.Finish() @@ -80,7 +80,7 @@ func TestMethodServiceTpsLimiterImplIsAllowableNoConfig(t *testing.T) { func TestMethodServiceTpsLimiterImplIsAllowableMethodLevelOverride(t *testing.T) { methodName := "hello2" methodConfigPrefix := "methods." + methodName + "." - invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{}, 0)) + invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{})) ctrl := gomock.NewController(t) defer ctrl.Finish() @@ -113,7 +113,7 @@ func TestMethodServiceTpsLimiterImplIsAllowableMethodLevelOverride(t *testing.T) func TestMethodServiceTpsLimiterImplIsAllowableBothMethodAndService(t *testing.T) { methodName := "hello3" methodConfigPrefix := "methods." + methodName + "." - invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{}, 0)) + invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{})) ctrl := gomock.NewController(t) defer ctrl.Finish() diff --git a/filter/filter_impl/tps_limit_filter_test.go b/filter/filter_impl/tps_limit_filter_test.go index 88e778105081129463b68618804bd9204d2f7113..55a3a55fab28efc7c27d9f5ccc4a3ec454bb6d15 100644 --- a/filter/filter_impl/tps_limit_filter_test.go +++ b/filter/filter_impl/tps_limit_filter_test.go @@ -44,7 +44,7 @@ func TestTpsLimitFilterInvokeWithNoTpsLimiter(t *testing.T) { invokeUrl := common.NewURLWithOptions( common.WithParams(url.Values{}), common.WithParamsValue(constant.TPS_LIMITER_KEY, "")) - attch := make(map[string]interface{}, 0) + attch := make(map[string]interface{}) result := tpsFilter.Invoke(context.Background(), protocol.NewBaseInvoker(invokeUrl), @@ -68,7 +68,7 @@ func TestGenericFilterInvokeWithDefaultTpsLimiter(t *testing.T) { invokeUrl := common.NewURLWithOptions( common.WithParams(url.Values{}), common.WithParamsValue(constant.TPS_LIMITER_KEY, constant.DEFAULT_KEY)) - attch := make(map[string]interface{}, 0) + attch := make(map[string]interface{}) result := tpsFilter.Invoke(context.Background(), protocol.NewBaseInvoker(invokeUrl), @@ -99,7 +99,7 @@ func TestGenericFilterInvokeWithDefaultTpsLimiterNotAllow(t *testing.T) { invokeUrl := common.NewURLWithOptions( common.WithParams(url.Values{}), common.WithParamsValue(constant.TPS_LIMITER_KEY, constant.DEFAULT_KEY)) - attch := make(map[string]interface{}, 0) + attch := make(map[string]interface{}) result := tpsFilter.Invoke(context.Background(), protocol.NewBaseInvoker( diff --git a/filter/filter_impl/tracing_filter.go b/filter/filter_impl/tracing_filter.go index b8058aa601af98b5416da882321546675459c413..dcdbe5b30e3c288462e9078df234243435ca86c6 100644 --- a/filter/filter_impl/tracing_filter.go +++ b/filter/filter_impl/tracing_filter.go @@ -83,7 +83,7 @@ func (tf *tracingFilter) Invoke(ctx context.Context, invoker protocol.Invoker, i }() result := invoker.Invoke(spanCtx, invocation) - span.SetTag(successKey, result.Error() != nil) + span.SetTag(successKey, result.Error() == nil) if result.Error() != nil { span.LogFields(log.String(errorKey, result.Error().Error())) } diff --git a/filter/filter_impl/tracing_filter_test.go b/filter/filter_impl/tracing_filter_test.go index e159b7400d46069018a00a849319423285072dc2..bf96a7d064b3919825d26c505b637f5ea539d9d6 100644 --- a/filter/filter_impl/tracing_filter_test.go +++ b/filter/filter_impl/tracing_filter_test.go @@ -57,6 +57,6 @@ func TestTracingFilterInvoke(t *testing.T) { tf.Invoke(ctx, invoker, inv) // has remote ctx - ctx = context.WithValue(context.Background(), constant.TRACING_REMOTE_SPAN_CTX, span.Context()) + ctx = context.WithValue(context.Background(), constant.DubboCtxKey(constant.TRACING_REMOTE_SPAN_CTX), span.Context()) tf.Invoke(ctx, invoker, inv) } diff --git a/go.mod b/go.mod index ee84df7e0c4f70e24f1c06f17b9bdc0a0200b391..a4a75f43dc21f50d3e4f634bb6d9b9ecd0fde951 100644 --- a/go.mod +++ b/go.mod @@ -1,44 +1,49 @@ module github.com/apache/dubbo-go +go 1.13 + require ( github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/RoaringBitmap/roaring v0.5.5 github.com/Workiva/go-datastructures v1.0.52 github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 - github.com/alibaba/sentinel-golang v0.6.2 - github.com/apache/dubbo-getty v1.3.10 - github.com/apache/dubbo-go-hessian2 v1.7.0 + github.com/alibaba/sentinel-golang v1.0.2 + github.com/apache/dubbo-getty v1.4.1 + github.com/apache/dubbo-go-hessian2 v1.8.2 github.com/coreos/etcd v3.3.25+incompatible github.com/creasty/defaults v1.5.1 github.com/dubbogo/go-zookeeper v1.0.2 - github.com/dubbogo/gost v1.9.5 + github.com/dubbogo/gost v1.11.0 github.com/elazarl/go-bindata-assetfs v1.0.0 // indirect github.com/emicklei/go-restful/v3 v3.4.0 + github.com/frankban/quicktest v1.4.1 // indirect github.com/fsnotify/fsnotify v1.4.9 github.com/go-co-op/gocron v0.1.1 github.com/go-resty/resty/v2 v2.3.0 github.com/golang/mock v1.4.4 github.com/golang/protobuf v1.4.3 github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 - github.com/hashicorp/consul v1.8.7 - github.com/hashicorp/consul/api v1.7.0 + github.com/hashicorp/consul v1.8.0 + github.com/hashicorp/consul/api v1.5.0 github.com/hashicorp/go-raftchunking v0.6.3-0.20191002164813-7e9e8525653a // indirect - github.com/hashicorp/vault/sdk v0.1.14-0.20200519221838-e0cfd64bc267 + github.com/hashicorp/vault/api v1.0.5-0.20191108163347-bdd38fca2cff // indirect + github.com/hashicorp/vault/sdk v0.1.14-0.20191112033314-390e96e22eb2 github.com/jinzhu/copier v0.0.0-20190625015134-976e0346caa8 github.com/magiconair/properties v1.8.4 - github.com/mitchellh/mapstructure v1.4.0 + github.com/mitchellh/mapstructure v1.4.1 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd - github.com/nacos-group/nacos-sdk-go v1.0.1 + github.com/nacos-group/nacos-sdk-go v1.0.5 github.com/opentracing/opentracing-go v1.2.0 + github.com/pierrec/lz4 v2.2.6+incompatible // indirect github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.8.0 github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b - github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect github.com/stretchr/objx v0.2.0 // indirect - github.com/stretchr/testify v1.6.1 + github.com/stretchr/testify v1.7.0 github.com/zouyx/agollo/v3 v3.4.5 go.uber.org/atomic v1.7.0 go.uber.org/zap v1.16.0 + golang.org/x/sys v0.0.0-20201223074533-0d417f636930 // indirect google.golang.org/grpc v1.26.0 gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.16.9 @@ -47,6 +52,8 @@ require ( k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a // indirect ) -replace github.com/shirou/gopsutil => github.com/shirou/gopsutil v0.0.0-20181107111621-48177ef5f880 - -go 1.13 +replace ( + github.com/coreos/bbolt => go.etcd.io/bbolt v1.3.4 + github.com/envoyproxy/go-control-plane => github.com/envoyproxy/go-control-plane v0.8.0 + github.com/shirou/gopsutil => github.com/shirou/gopsutil v0.0.0-20181107111621-48177ef5f880 +) diff --git a/go.sum b/go.sum index 4948848529c802b7f2875521bd717ab9a1bd9c14..ba15b5d94337a39630d6ffbc526485684b95c875 100644 --- a/go.sum +++ b/go.sum @@ -4,37 +4,27 @@ cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSR cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3 h1:AVXDdKsrtX33oR9fbCMu/+c1o8Ofjq6Ku/MInaLVg5Y= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0 h1:0E3eE8MX426vUOs7aHfI7aN1BrIzzzf4ccKCSfSjGmc= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-sdk-for-go v32.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v40.3.0+incompatible h1:NthZg3psrLxvQLN6rVm07pZ9mv2wvGNaBNGQ3fnPvLE= github.com/Azure/azure-sdk-for-go v40.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-autorest/autorest v0.1.0/go.mod h1:AKyIcETwSUFxIcs/Wnq/C+kwCtlEYGUVd7FPNb2slmg= -github.com/Azure/go-autorest/autorest v0.5.0/go.mod h1:9HLKlQjVBH6U3oDfsXOeVc56THsLPw1L03yban4xThw= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0= github.com/Azure/go-autorest/autorest v0.10.0 h1:mvdtztBqcL8se7MdrUweNieTNi4kfNG6GOJuurQJpuY= github.com/Azure/go-autorest/autorest v0.10.0/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= -github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= -github.com/Azure/go-autorest/autorest/adal v0.2.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/adal v0.8.2 h1:O1X4oexUxnZCaEUGsvMnr8ZGj8HI37tNezwY4npRqA0= github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/azure/auth v0.1.0/go.mod h1:Gf7/i2FUpyb/sGBLIFxTBzrNzBo7aPXXE3ZVeDRwdpM= github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 h1:iM6UAvjR97ZIeR93qTcwpKNMpV+/FTWjwEbuPD495Tk= github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM= -github.com/Azure/go-autorest/autorest/azure/cli v0.1.0/go.mod h1:Dk8CUAt/b/PzkfeRsWzVG9Yj3ps8mS8ECztu43rdU8U= github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 h1:LXl088ZQlP0SBppGFsRZonW6hSvwgL5gRByMbvUbx8U= github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= @@ -44,15 +34,12 @@ github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxB github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.3.0 h1:qJumjCaCudz+OcqE9/XtEPfvtOjOmKaui4EOpFI6zZc= github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= -github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= github.com/Azure/go-autorest/autorest/to v0.3.0 h1:zebkZaadz7+wIQYgC7GXaz3Wb28yKYfVkkBKwc38VF8= github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= -github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= github.com/Azure/go-autorest/autorest/validation v0.2.0 h1:15vMO4y76dehZSq7pAaOLQxC6dZYsSrj2GQpflyM/L4= github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= @@ -62,16 +49,13 @@ github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Microsoft/go-winio v0.4.3 h1:M3NHMuPgMSUPdE5epwNUHlRPSVzHs8HpRTrVXhR0myo= github.com/Microsoft/go-winio v0.4.3/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 h1:ygIc8M6trr62pF5DucadTWGdEB4mEyvzi0e2nbcmcyA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/hcsshim v0.8.7-0.20191101173118-65519b62243c/go.mod h1:7xhjOwRV2+0HXGmM0jxaEu+ZiXJFoVZOTfL/dmqbrD8= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/NYTimes/gziphandler v1.0.1/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87/go.mod h1:iGLljf5n9GjT6kc0HBvyI1nOKnGQbNB66VzSNbK5iks= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/RoaringBitmap/roaring v0.5.5 h1:naNqvO1mNnghk2UvcsqnzHDBn9DRbCIRy94GmDTRVTQ= @@ -88,25 +72,19 @@ github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af h1:DBNMBMuMiWYu0b+8KM github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 h1:rFw4nCn9iMW+Vajsk51NtYIcwSTkXr+JGrMd36kTDJw= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/akamai/AkamaiOPEN-edgegrid-golang v0.9.0/go.mod h1:zpDJeKyp9ScW4NNrbdr+Eyxvry3ilGPewKoXw3XGN1k= -github.com/alangpierce/go-forceexport v0.0.0-20160317203124-8f1d6941cd75/go.mod h1:uAXEEpARkRhCZfEvy/y0Jcc888f9tHCc1W7/UeEtreE= -github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alibaba/sentinel-golang v0.6.2 h1:1OjjpljJbNKWp9p5RJKxOqS1gHGZPUWPlCcokv5xYJs= -github.com/alibaba/sentinel-golang v0.6.2/go.mod h1:5jemKdyCQCKVf+quEia53fo9a17OSe+wnl9HX2NbNpc= -github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190808125512-07798873deee/go.mod h1:myCDvQSzCW+wB1WAlocEru4wMGJxy+vlxHdhegi1CDQ= +github.com/alibaba/sentinel-golang v1.0.2 h1:Acopq74hOtZN4MV1v811MQ6QcqPFLDSczTrRXv9zpIg= +github.com/alibaba/sentinel-golang v1.0.2/go.mod h1:QsB99f/z35D2AiMrAWwgWE85kDTkBUIkcmPrRt+61NI= github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 h1:zOVTBdCKFd9JbCKz9/nt+FovbjPFmb7mUnp8nH9fQBA= github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk= -github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/apache/dubbo-getty v1.3.10 h1:ys5mwjPdxG/KwkPjS6EI0RzQtU6p6FCPoKpaFEzpAL0= -github.com/apache/dubbo-getty v1.3.10/go.mod h1:x6rraK01BL5C7jUM2fPl5KMkAxLVIx54ZB8/XEOik9Y= -github.com/apache/dubbo-go-hessian2 v1.7.0 h1:u2XxIuepu/zb6JcGZc7EbvKboXdKoJbf7rbmeq6SF1w= -github.com/apache/dubbo-go-hessian2 v1.7.0/go.mod h1:7rEw9guWABQa6Aqb8HeZcsYPHsOS7XT1qtJvkmI6c5w= +github.com/apache/dubbo-getty v1.4.1 h1:M9yaFhemThQSWtRwmJNrxNuv7FzydlFx5EY8oq1v+lw= +github.com/apache/dubbo-getty v1.4.1/go.mod h1:ansXgKxxyhCOiQL29nO5ce1MDcEKmCyZuNR9oMs3hek= +github.com/apache/dubbo-go-hessian2 v1.8.2 h1:CQq2Mmlrk6Fqmudwl9Dqps8drTrBFnmXRlzgOjj0FqA= +github.com/apache/dubbo-go-hessian2 v1.8.2/go.mod h1:xQUjE7F8PX49nm80kChFvepA/AvqAZ0oh/UaB6+6pBE= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA= @@ -116,77 +94,45 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg= github.com/armon/go-metrics v0.3.0 h1:B7AQgHi8QSEi4uHu7Sbsga+IJDU+CENgjxoo81vDUqU= github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD+gJD3GYs= -github.com/armon/go-metrics v0.3.4 h1:Xqf+7f2Vhl9tsqDYmXhnXInUdcrtgpRNpIA15/uldSc= -github.com/armon/go-metrics v0.3.4/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.23.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.41/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0 h1:0xphMHGMLBrPMfxR2AmVjZKcMEESEgWF8Kru94BNByk= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23 h1:D21IyuvjDCshj1/qq+pCNd3VZOAEI9jy6Bi131YlXgI= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/bwmarrin/discordgo v0.20.2/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVOwN61zSZ0r4Q= -github.com/caddyserver/certmagic v0.10.6/go.mod h1:Y8jcUBctgk/IhpAzlHKfimZNyXCkfGgRTC0orl8gROQ= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/cenkalti/backoff/v4 v4.0.0/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg= -github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible h1:C29Ae4G5GtYyYMm1aztcyj/J5ckgJm2zwdDajFbx1NY= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3 h1:TJH+oke8D16535+jHExHj4nQvzlZrj7ug5D7I/orNUA= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.10.2/go.mod h1:qhVI5MKwBGhdNU89ZRz2plgYutcJ5PCekLxXn56w6SY= -github.com/cncf/udpa/go v0.0.0-20200313221541-5f7e5dd04533 h1:8wZizuKuZVu5COB7EsBYxBQz8nRcXXn5d4Gt91eJLvU= -github.com/cncf/udpa/go v0.0.0-20200313221541-5f7e5dd04533/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= github.com/coredns/coredns v1.1.2 h1:bAFHrSsBeTeRG5W3Nf2su3lUGw7Npw2UKeCJm/3A638= github.com/coredns/coredns v1.1.2/go.mod h1:zASH/MVDgR6XZTbxvOnsZfffS+31vg6Ackf/wo1+AM0= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/bbolt v1.3.3 h1:n6AiVyVRKQFNb6mJlwESEvvLoDyiTzXX7ORAUlkeBdY= -github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.18+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.25+incompatible h1:0GQEw6h3YnuOVdtwygkIfJ+Omx0tZ8/QkVyXI4LkbeY= github.com/coreos/etcd v3.3.25+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= @@ -196,18 +142,14 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c= -github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpu/goacmedns v0.0.1/go.mod h1:sesf/pNnCYwUevQEQfEwY0Y3DydlQWSGZbaMElOWxok= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creasty/defaults v1.5.1 h1:j8WexcS3d/t4ZmllX4GEkl4wIB/trOr035ajcLHCISM= github.com/creasty/defaults v1.5.1/go.mod h1:FPZ+Y0WNrbqOVw+c6av63eyHUAl6pMHZwqLPvXUZGfY= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -224,22 +166,19 @@ github.com/digitalocean/godo v1.10.0 h1:uW1/FcvZE/hoixnJcnlmIUvTVNdZCLjRLzmDtRi1 github.com/digitalocean/godo v1.10.0/go.mod h1:h6faOIcZ8lWIwNQ+DN7b3CgX4Kwby5T+nbpNqkUIozU= github.com/dimchansky/utfbom v1.1.0 h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TRo4= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= -github.com/dnaeon/go-vcr v0.0.0-20180814043457-aafff18a5cc2/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/dnsimple/dnsimple-go v0.30.0/go.mod h1:O5TJ0/U6r7AfT8niYNlmohpLbCSG+c71tQlGr9SeGrg= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v1.4.2-0.20191101170500-ac7306503d23/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.3.0 h1:3lOnM9cSzgGwx8VfK/NGOW5fLQ0GjIlCkaktF+n1M6o= github.com/docker/go-connections v0.3.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/dubbogo/go-zookeeper v1.0.2 h1:xmEnPL8SlCe3/+J5ZR9e8qE35LmFVYe8VVpDakjNM4A= github.com/dubbogo/go-zookeeper v1.0.2/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c= github.com/dubbogo/gost v1.9.0/go.mod h1:pPTjVyoJan3aPxBPNUX0ADkXjPibLo+/Ib0/fADXSG8= -github.com/dubbogo/gost v1.9.5 h1:UeG4y0O55lR3dzgdmCm/7bMWvpKrlpR7fsfKjrcXq/g= -github.com/dubbogo/gost v1.9.5/go.mod h1:QNM5RaeRdNWehUu8S0hUP5Qa8QUfGf6KH1JhqOVFvEI= +github.com/dubbogo/gost v1.10.1 h1:39kF9Cd5JOiMpmwG6dX1/aLWNFqFv9gHp8HrhzMmjLY= +github.com/dubbogo/gost v1.10.1/go.mod h1:+mQGS51XQEUWZP2JeGZTxJwipjRKtJO7Tr+FOg+72rI= +github.com/dubbogo/gost v1.11.0 h1:9KtyWQz1gMlAfwzen5iyhMdoe08SPBBUVhco4rdgJ9I= +github.com/dubbogo/gost v1.11.0/go.mod h1:w8Yw29eDWtRVo3tx9nPpHkNZnOi4SRx1fZf7eVlAAU4= +github.com/dubbogo/jsonparser v1.0.1/go.mod h1:tYAtpctvSP/tWw4MeelsowSPgXQRVHHWbqL6ynps8jU= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -247,7 +186,6 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/ef-ds/deque v1.0.4-0.20190904040645-54cb57c252a1/go.mod h1:HvODWzv6Y6kBf3Ah2WzN1bHjDUezGLaAhwuWVwfpEJs= github.com/elazarl/go-bindata-assetfs v0.0.0-20160803192304-e1a2a7ec64b0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk= github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= @@ -256,60 +194,42 @@ github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 h1:H2pdYOb3KQ1 github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful/v3 v3.4.0 h1:IIDhql3oyWZj1ay2xBZGb4sTOWMad0HVW8rwhVxN/Yk= github.com/emicklei/go-restful/v3 v3.4.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= -github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.5 h1:lRJIqDD8yjV1YyPRqecMdytjDLs2fTXq363aCib5xPU= -github.com/envoyproxy/go-control-plane v0.9.5/go.mod h1:OXl5to++W0ctG+EHWTFUjiypVxC/Y4VLc/KFU+al13s= +github.com/envoyproxy/go-control-plane v0.8.0 h1:uE6Fp4fOcAJdc1wTQXLJ+SYistkbG1dNoi6Zs1+Ybvk= +github.com/envoyproxy/go-control-plane v0.8.0/go.mod h1:GSSbY9P1neVhdY7G4wu+IK1rk/dqhiCC/4ExuWJZVuk= +github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.0.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= -github.com/exoscale/egoscale v0.18.1/go.mod h1:Z7OOdzzTOz1Q1PjQXumlz9Wn/CddH0zSYdCF3rnBKXE= github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 h1:Ghm4eQYC0nEPnSJdVkTrXpu9KtoVCSo1hg7mtI7G9KU= github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239/go.mod h1:Gdwt2ce0yfBxPvZrHkprdPPTTS3N5rwmLE8T22KBXlw= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/forestgiant/sliceutil v0.0.0-20160425183142-94783f95db6c/go.mod h1:pFdJbAhRf7rh6YYMUdIQGyzne6zYL1tCUW8QV2B3UfY= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.11.1 h1:stwUsXhUGliQs9t0ZS39BWCltFdOHgABiIlihop8AD4= -github.com/frankban/quicktest v1.11.1/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= +github.com/frankban/quicktest v1.4.1 h1:Wv2VwvNn73pAdFIVUQRXYDFp31lXKbqblIXo/Q5GPSg= +github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= 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/fsouza/go-dockerclient v1.6.0/go.mod h1:YWwtNPuL4XTX1SKJQk86cWPmmqwx+4np9qfPbb+znGc= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= -github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2 h1:Ujru1hufTHVb++eG6OuNDKMxZnGIvF6o/u8q/8h2+I4= github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31 h1:gclg6gY70GLy3PbkQ1AERPfmLMMagS60DKF78eWwLn8= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-acme/lego/v3 v3.4.0/go.mod h1:xYbLDuxq3Hy4bMUT1t9JIuz6GWIWb3m5X+TeTHYaT7M= github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= -github.com/go-cmd/cmd v1.0.5/go.mod h1:y8q8qlK5wQibcw63djSl/ntiHUHXHGdCkPk0j4QeW4s= github.com/go-co-op/gocron v0.1.1 h1:OfDmkqkCguFtFMsm6Eaayci3DADLa8pXvdmOlPU/JcU= github.com/go-co-op/gocron v0.1.1/go.mod h1:Y9PWlYqDChf2Nbgg7kfS+ZsXHDTZbMZYPEQ0MILqH+M= github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= -github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= -github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= -github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.44.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-ldap/ldap/v3 v3.1.3/go.mod h1:3rbOH3jRS2u6jg2rJnKAMLE/xQyCKIveG2Sa/Cohzb8= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= @@ -322,38 +242,28 @@ github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+ github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= -github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= github.com/go-redis/redis v6.15.5+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-resty/resty/v2 v2.3.0 h1:JOOeAvjSlapTT92p8xiS19Zxev1neGikoHsXJeOq8So= github.com/go-resty/resty/v2 v2.3.0/go.mod h1:UpN9CgLZNsv4e9XG50UU8xdI0F43UQ4HmxLBDwaroHU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.3/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= -github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.1.0 h1:kFkMAZBNAn4j7K0GiZr8cRYzejq68VbheufiV3YuyFI= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -361,10 +271,8 @@ github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 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= @@ -384,8 +292,6 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= 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/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= @@ -407,49 +313,39 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g= github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/gophercloud/gophercloud v0.1.0 h1:P/nh25+rzXouhytV2pUHBb65fnds26Ghl8/391+sT5o= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gophercloud/gophercloud v0.3.0 h1:6sjpKIpVwRIIwmcEGp+WwNovNsem+c+2vm6oxshRpL8= -github.com/gophercloud/gophercloud v0.3.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99 h1:twflg0XRTjwKpxb/jFExr4HGq6on2dEOmnL6FV+fgPw= github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 h1:THDBEeQ9xZ8JEaCLyLQqXMMdRqNr0QAUJTIkQAUtFjg= -github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5 h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= -github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= -github.com/hashicorp/consul v1.8.7 h1:PKZTnFLBc0cpdkD0QV1DCQ9+AbW/QWKfBuWHRGJ7Uq8= -github.com/hashicorp/consul v1.8.7/go.mod h1:bNsHf1jYs36NJLuxmtMovGelihVDYBNm+0xifkufuPI= +github.com/hashicorp/consul v1.8.0 h1:yRKMKZyPLqUxl37t4nFt5OuGmTXoFhTJrakhfnYKCYA= +github.com/hashicorp/consul v1.8.0/go.mod h1:Gg9/UgAQ9rdY3CTvzQZ6g2jcIb7NlIfjI+0pvLk5D1A= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/api v1.4.0/go.mod h1:xc8u05kyMa3Wjr9eEAsIAo3dg8+LywT5E/Cl7cNS5nU= -github.com/hashicorp/consul/api v1.7.0 h1:tGs8Oep67r8CcA2Ycmb/8BLBcJ70St44mF2X10a/qPg= -github.com/hashicorp/consul/api v1.7.0/go.mod h1:1NSuaUUkFaJzMasbfq/11wKYWSR67Xn6r2DXKhuDNFg= +github.com/hashicorp/consul/api v1.5.0 h1:Yo2bneoGy68A7aNwmuETFnPhjyBEm7n3vzRacEVMjvI= +github.com/hashicorp/consul/api v1.5.0/go.mod h1:LqwrLNW876eYSuUOo4ZLHBcdKc038txr/IMfbLPATa4= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.4.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= -github.com/hashicorp/consul/sdk v0.6.0 h1:FfhMEkwvQl57CildXJyGHnwGGM4HMODGyfjGwNM1Vdw= -github.com/hashicorp/consul/sdk v0.6.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= -github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/consul/sdk v0.5.0 h1:WC4594Wp/LkEeML/OdQKEC1yqBmEYkRp6i7X5u0zDAs= +github.com/hashicorp/consul/sdk v0.5.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-bexpr v0.1.2 h1:ijMXI4qERbzxbCnkxmfUtwMyjrrk3y+Vt0MxojNCbBs= @@ -463,6 +359,7 @@ github.com/hashicorp/go-connlimit v0.2.0/go.mod h1:OUj9FGL1tPIhl/2RCfzYHrIiWj+VV github.com/hashicorp/go-discover v0.0.0-20200501174627-ad1e96bde088 h1:jBvElOilnIl6mm8S6gva/dfeTJCcMs9TGO6/2C6k52E= github.com/hashicorp/go-discover v0.0.0-20200501174627-ad1e96bde088/go.mod h1:vZu6Opqf49xX5lsFAu7iFNewkcVF1sn/wyapZh5ytlg= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= +github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.9.1/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.12.0 h1:d4QkX8FRTYaKaCZBoXYY8zJX2BXjWxurN/GA2tkrmZM= @@ -470,15 +367,11 @@ github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39 github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.1.0 h1:vN9wG1D6KG6YHRTWr8512cxGOVgTMEfgEdSj/hr8MPc= github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.2.0 h1:l6UW37iCXwZkZoAbEYnptSHVE/cQ5bOTPYG5W3vf9+8= -github.com/hashicorp/go-immutable-radix v1.2.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-kms-wrapping/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g= github.com/hashicorp/go-memdb v1.0.3 h1:iiqzNk8jKB6/sLRj623Ui/Vi1zf21LOUpgzGjTge6a8= github.com/hashicorp/go-memdb v1.0.3/go.mod h1:LWQ8R70vPrS4OEY9k28D2z8/Zzyu34NVzeRibGAzHO0= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 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-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= @@ -487,10 +380,11 @@ github.com/hashicorp/go-raftchunking v0.6.1/go.mod h1:cGlg3JtDy7qy6c/3Bu660Mic1J github.com/hashicorp/go-raftchunking v0.6.3-0.20191002164813-7e9e8525653a h1:FmnBDwGwlTgugDGbVxwV8UavqSMACbGrUpfc98yFLR4= github.com/hashicorp/go-raftchunking v0.6.3-0.20191002164813-7e9e8525653a/go.mod h1:xbXnmKqX9/+RhPkJ4zrEx4738HacP72aaUPlT2RZ4sU= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.6.7 h1:8/CAEZt/+F7kR7GevNHulKkUjLht3CPmn7egmhieNKo= -github.com/hashicorp/go-retryablehttp v0.6.7/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-retryablehttp v0.6.2 h1:bHM2aVXwBtBJWxHtkSrWuI4umABCUczs52eiUS9nSiw= +github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6cc2C1mDaW3NQ9sY1FY= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -500,6 +394,7 @@ github.com/hashicorp/go-syslog v1.0.0 h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwM github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2-0.20191001231223-f32f5fe8d6a8/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/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -507,11 +402,8 @@ github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+d github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= -github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= 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/hil v0.0.0-20160711231837-1e86c6b523c5 h1:uk280DXEbQiCOZgCOI3elFSeNxf8YIZiNsbr2pQLYD0= @@ -521,6 +413,7 @@ github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0m github.com/hashicorp/mdns v1.0.1 h1:XFSOubp8KWB+Jd2PDyaX5xUd5bhSP/+pTDZVDMzZJM8= github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.2.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.2.2 h1:5+RffWKwqJ71YPu9mWsF7ZOscZmwfasdA8kbdC7AO2g= github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/net-rpc-msgpackrpc v0.0.0-20151116020338-a14192a58a69 h1:lc3c72qGlIMDqQpQH82Y4vaglRMMFdJbziYWriR4UcE= @@ -532,13 +425,16 @@ github.com/hashicorp/raft v1.1.2/go.mod h1:vPAJM8Asw6u8LxC3eJCUZmRP/E4QmUGE1R7g7 github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea h1:xykPFhrBAS2J0VBzVa5e80b5ZtYuNQtgXjN40qBZlD4= github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea/go.mod h1:pNv7Wc3ycL6F5oOWn+tPGo2gWD4a5X+yp/ntwdKLjRk= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/serf v0.9.3/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= -github.com/hashicorp/serf v0.9.4 h1:xrZ4ZR0wT5Dz8oQHHdfOzr0ei1jMToWlFFz3hh/DI7I= -github.com/hashicorp/serf v0.9.4/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= -github.com/hashicorp/vault/api v1.0.5-0.20200717191844-f687267c8086 h1:OKsyxKi2sNmqm1Gv93adf2AID2FOBFdCbbZn9fGtIdg= -github.com/hashicorp/vault/api v1.0.5-0.20200717191844-f687267c8086/go.mod h1:R3Umvhlxi2TN7Ex2hzOowyeNb+SfbVWI973N+ctaFMk= -github.com/hashicorp/vault/sdk v0.1.14-0.20200519221838-e0cfd64bc267 h1:e1ok06zGrWJW91rzRroyl5nRNqraaBe4d5hiKcVZuHM= -github.com/hashicorp/vault/sdk v0.1.14-0.20200519221838-e0cfd64bc267/go.mod h1:WX57W2PwkrOPQ6rVQk+dy5/htHIaB4aBM70EwKThu10= +github.com/hashicorp/serf v0.9.0/go.mod h1:YL0HO+FifKOW2u1ke99DGVu1zhcpZzNwrLIqBC7vbYU= +github.com/hashicorp/serf v0.9.2 h1:yJoyfZXo4Pk2p/M/viW+YLibBFiIbKoP79gu7kDAFP0= +github.com/hashicorp/serf v0.9.2/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= +github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= +github.com/hashicorp/vault/api v1.0.5-0.20191108163347-bdd38fca2cff h1:cl94LQIrs/mNbh3ny1R8lM1gtYcUBa7HnGtOCi35SlQ= +github.com/hashicorp/vault/api v1.0.5-0.20191108163347-bdd38fca2cff/go.mod h1:Uf8LaHyrYsgVgHzO2tMZKhqRGlL3UJ6XaSwW2EA1Iqo= +github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= +github.com/hashicorp/vault/sdk v0.1.14-0.20191108161836-82f2b5571044/go.mod h1:PcekaFGiPJyHnFy+NZhP6ll650zEw51Ag7g/YEa+EOU= +github.com/hashicorp/vault/sdk v0.1.14-0.20191112033314-390e96e22eb2 h1:mKYi4Fm2uSfe94Ji89CoAaP7SPEEkfdtaUlgRGGb2go= +github.com/hashicorp/vault/sdk v0.1.14-0.20191112033314-390e96e22eb2/go.mod h1:PcekaFGiPJyHnFy+NZhP6ll650zEw51Ag7g/YEa+EOU= github.com/hashicorp/vic v1.5.1-0.20190403131502-bbfe86ec9443 h1:O/pT5C1Q3mVXMyuqg7yuAWUg/jMZR1/0QTzTRdNR6Uw= github.com/hashicorp/vic v1.5.1-0.20190403131502-bbfe86ec9443/go.mod h1:bEpDU35nTu0ey1EXjwNwPjI9xErAsoOCmcMb9GKvyxo= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= @@ -547,21 +443,17 @@ github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKe github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df/go.mod h1:QMZY7/J/KSQEhKWFeDesPjMj+wCHReeknARU3wqlyN4= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= -github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ= github.com/jackc/pgx v3.3.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/jarcoal/httpmock v0.0.0-20180424175123-9c70cfe4a1da h1:FjHUJJ7oBW4G/9j1KzlHaXL09LyMVM9rupS39lncbXk= github.com/jarcoal/httpmock v0.0.0-20180424175123-9c70cfe4a1da/go.mod h1:ks+b9deReOc7jgqp+e7LuFiCBH6Rm5hL32cLcEAArb4= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 h1:IPJ3dvxmJ4uczJe5YQdrYB16oTJlGSC/OyZDqUk9xX4= github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jinzhu/copier v0.0.0-20190625015134-976e0346caa8 h1:mGIXW/lubQ4B+3bXTLxcTMTjUNDqoF6T/HUW9LbFx9s= github.com/jinzhu/copier v0.0.0-20190625015134-976e0346caa8/go.mod h1:yL958EeXv8Ylng6IfnvG4oflryUi3vgA3xPs9hmII1s= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= @@ -577,7 +469,6 @@ github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -585,14 +476,13 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= +github.com/k0kubun/pp v3.0.1+incompatible h1:3tqvf7QgUnZ5tXO6pNAZlrvHgl6DvifjDrd9g2S9Z40= github.com/k0kubun/pp v3.0.1+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= -github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/kolo/xmlrpc v0.0.0-20190717152603-07c4ee3fd181/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ= 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/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= @@ -601,17 +491,9 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= 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/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/labbsr0x/bindman-dns-webhook v1.0.2/go.mod h1:p6b+VCXIR8NYKpDr8/dg1HKfQoRHCdcsROXKvmoehKA= -github.com/labbsr0x/goh v1.0.1/go.mod h1:8K2UhVoaWXcCU7Lxoa2omWnC8gyW8px7/lmO61c027w= -github.com/labstack/echo/v4 v4.1.15/go.mod h1:GWO5IBVzI371K8XJe50CSvHjQCafK6cw8R/moLhEU6o= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570 h1:0iQektZGS248WXmGIYOwRXSQhD4qn3icjMpuxwO7qlo= github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570/go.mod h1:BLt8L9ld7wVsvEWQbuLrUZnCMnUmLZ+CGDzKtclrTlE= github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f h1:sgUSP4zdTUZYZgAGGtN5Lxk92rK+JUFOwf+FT99EEI4= @@ -619,25 +501,17 @@ github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f/go.mod github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042 h1:Bvq8AziQ5jFF4BHGAEDSqwPW1NJS3XshxbRCxtjFAZc= github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042/go.mod h1:TPpsiPUEh0zFL1Snz4crhMlBe60PYxRHr5oFF3rRYg0= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/linode/linodego v0.7.1 h1:4WZmMpSA2NRwlPZcc0+4Gyn7rr99Evk9bnr0B3gXRKE= github.com/linode/linodego v0.7.1/go.mod h1:ga11n3ivecUrPCHN0rANxKmfWBJVkOXfLMZinAbj2sY= -github.com/linode/linodego v0.10.0 h1:AMdb82HVgY8o3mjBXJcUv9B+fnJjfDMn2rNRGbX+jvM= -github.com/linode/linodego v0.10.0/go.mod h1:cziNP7pbvE3mXIPneHj0oRY8L1WtGEIKlZ8LANE4eXA= -github.com/liquidweb/liquidweb-go v1.6.0/go.mod h1:UDcVnAMDkZxpw4Y7NOHkqoeiGacVLEIG/i5J9cyixzQ= -github.com/lucas-clemente/quic-go v0.14.1/go.mod h1:Vn3/Fb0/77b02SGhQk36KzOUmXgVpFfizUfW5WMaqyU= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.4 h1:8KGKTcQQGm0Kv7vEbKFErAoAOFyyacLStRtQSeYtvkY= github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/marten-seemann/chacha20 v0.2.0/go.mod h1:HSdjFau7GzYRj+ahFNwsO3ouVJr1HFkWoEwNDb4TMtE= -github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= -github.com/marten-seemann/qtls v0.4.1/go.mod h1:pxVXcHHw1pNIt8Qo0pwSYQEoZ8yYOOPXTCZLQQunvRc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw= @@ -645,24 +519,17 @@ github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/micro/cli/v2 v2.1.2/go.mod h1:EguNh6DAoWKm9nmk+k/Rg0H3lQnDxqzu5x5srOtGtYg= -github.com/micro/go-micro/v2 v2.9.1/go.mod h1:x55ZM3Puy0FyvvkR3e0ha0xsE9DFwfPSUMWAIbFY0SY= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26 h1:gPxPSwALAeHJSjarOs00QjVdV9QoBvc1D2ujQUr5BzU= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/miekg/dns v1.1.27 h1:aEH/kqUzUxGJ/UHcEKdJY+ugH6WEzsEBBSPa8zuy1aM= -github.com/miekg/dns v1.1.27/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0 h1:tEElEatulEHDeedTxwckzyYMA5c86fbmNIUL1hBIiTg= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= @@ -675,19 +542,16 @@ github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go. github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.0 h1:/x0XQ6h+3U3nAyk1yx+bHPURrKa9sVVvYbuqZ7pIAtI= github.com/mitchellh/go-testing-interface v1.14.0/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= -github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed/go.mod h1:3rdaFaCv4AyBgu5ALFM0+tSuHrBh6v692nyQe3ikrq0= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452 h1:hOY53G+kBFhbYFpRVxHl5eS7laP6B1+Cq+Z9Dry1iMU= github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= -github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= -github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.0 h1:7ks8ZkOP5/ujthUsT07rNv+nkLXCQWKNHuwzOAesEks= -github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.2.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.0.0 h1:ATSdz4NWrmWPOF1CeCBU4sMCno2hgqdbSrRPFWQSVZI= github.com/mitchellh/pointerstructure v1.0.0/go.mod h1:k4XwG94++jLVsSiTxo7qdIfXA9pj9EAeo0QsNNJOLZ8= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -700,43 +564,28 @@ github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lN github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae h1:VeRdUYdCw49yizlSbMEn2SZ+gT+3IUKx8BqxyQdz+BY= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nacos-group/nacos-sdk-go v1.0.0/go.mod h1:hlAPn3UdzlxIlSILAyOXKxjFSvDJ9oLzTJ9hLAK1KzA= -github.com/nacos-group/nacos-sdk-go v1.0.1 h1:VNmXGlSS28xOmkO5Nxk5WRp6f1HMosAmG9pDtcnUFcw= -github.com/nacos-group/nacos-sdk-go v1.0.1/go.mod h1:hlAPn3UdzlxIlSILAyOXKxjFSvDJ9oLzTJ9hLAK1KzA= -github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04/go.mod h1:5sN+Lt1CaY4wsPvgQH/jsuJi4XO2ssZbdsIizr4CVC8= +github.com/nacos-group/nacos-sdk-go v1.0.5 h1:xwLS0Ao7fSB3HoDFR+JRZ1fh0HuvgHPOWBdals37Oxc= +github.com/nacos-group/nacos-sdk-go v1.0.5/go.mod h1:hlAPn3UdzlxIlSILAyOXKxjFSvDJ9oLzTJ9hLAK1KzA= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats-server/v2 v2.1.6/go.mod h1:BL1NOtaBQ5/y97djERRVWNouMW7GT3gxnmbE/eC8u8A= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nats.go v1.9.2/go.mod h1:AjGArbfyR50+afOUotNX2Xs5SYHf+CoOa5HH1eEl2HE= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.4/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nicolai86/scaleway-sdk v1.10.2-0.20180628010248-798f60e20bb2 h1:BQ1HW7hr4IVovMwWg0E0PYcyW8CzqDcVmaew9cujU4s= github.com/nicolai86/scaleway-sdk v1.10.2-0.20180628010248-798f60e20bb2/go.mod h1:TLb2Sg7HQcgGdloNxkrmtgDNR9uVYF3lfdFIN4Ro6Sk= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nlopes/slack v0.6.1-0.20191106133607-d06c2a2b3249/go.mod h1:JzQ9m3PMAqcpeCam7UaHSuBuupz7CmpjehYMayT6YOk= -github.com/nrdcg/auroradns v1.0.0/go.mod h1:6JPXKzIRzZzMqtTDgueIhTi6rFf1QvYE/HzqidhOhjw= -github.com/nrdcg/dnspod-go v0.4.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ= -github.com/nrdcg/goinwx v0.6.1/go.mod h1:XPiut7enlbEdntAqalBIqcYcTEVhpv/dKWgDCX2SwKQ= -github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.0-20180130162743-b8a9be070da4/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -749,13 +598,6 @@ github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -766,9 +608,6 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/oracle/oci-go-sdk v7.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888= -github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014/go.mod h1:joRatxRJaZBsY3JAOEMcoOp05CnZzsx4scTxi95DHyQ= -github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= github.com/packethost/packngo v0.1.1-0.20180711074735-b9cb5096f54c h1:vwpFWvAO8DeIZfFeqASzZfsxuWPno9ncAebBEP0N3uE= github.com/packethost/packngo v0.1.1-0.20180711074735-b9cb5096f54c/go.mod h1:otzZQXgoO96RTzDB/Hycg0qZcXZsWJGJRSXbmEIJ+4M= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= @@ -786,8 +625,8 @@ github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUMhxq9m9ZXI= -github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.2.6+incompatible h1:6aCX4/YZ9v8q69hTyiR7dNLnTA3fgtKHVVW5BCd5Znw= +github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= 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= @@ -806,16 +645,13 @@ github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4 github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= -github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.8.0 h1:zvJNkoCFAnYFNC24FV8nW4JdRJ3GIFcLbg65lL/JDcw= github.com/prometheus/client_golang v1.8.0/go.mod h1:O9VU6huf47PktckDQfMTX0Y8tY0/7TSWwj+ITvv0TnM= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -824,9 +660,7 @@ github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7q github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.14.0 h1:RHRyE8UocrbjU+6UvRzwi6HjiDfxrrBU91TtbKzkGp4= github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= @@ -835,14 +669,11 @@ github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rainycape/memcache v0.0.0-20150622160815-1031fa0ce2f2/go.mod h1:7tZKcyumwBO6qip7RNQ5r77yrssm9bfCowcLEBcU5IA= github.com/rboyer/safeio v0.2.1/go.mod h1:Cq/cEPK+YXFn622lsQ0K4KsPZSPtaptHHEldsy7Fmig= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/renier/xmlrpc v0.0.0-20170708154548-ce4a1a486c03 h1:Wdi9nwnhFNAlseAOekn6B5G/+GMtks9UKbvRU/CMM/o= @@ -856,7 +687,6 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/sacloud/libsacloud v1.26.1/go.mod h1:79ZwATmHLIFZIMd7sxA3LwzVy/B77uj3LDoToVTxDoQ= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b h1:gQZ0qzfKHQIybLANtM3mBXNUtOfsCFXeTsnBqCsx1KM= @@ -865,7 +695,6 @@ github.com/sean-/conswriter v0.0.0-20180208195008-f5ae3917a627/go.mod h1:7zjs06q github.com/sean-/pager v0.0.0-20180208200047-666be9bf53b5/go.mod h1:BeybITEsBEg6qbIiqJ6/Bqeq25bCLbL7YFmpaFfJDuM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shirou/gopsutil v0.0.0-20181107111621-48177ef5f880 h1:1Ge4j/3uB2rxzPWD3TC+daeCw+w91z8UCUL/7WH5gn8= github.com/shirou/gopsutil v0.0.0-20181107111621-48177ef5f880/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 h1:udFKJ0aHUL60LboW/A+DfgoHVedieIzIXE8uylPue0U= @@ -874,11 +703,9 @@ github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9Nz github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.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/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= @@ -923,58 +750,42 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P 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/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tebeka/strftime v0.1.3 h1:5HQXOqWKYRFfNyBMNVc9z5+QzuBtIXy03psIhtdJYto= github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ= -github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog= github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible h1:8uRvJleFpqLsO77WaAh2UrasMOzd8MxXrNj20e7El+Q= github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= github.com/tent/http-link-go v0.0.0-20130702225549-ac974c61c2f9/go.mod h1:RHkNRtSLfOK7qBTHaeSX1D6BNpI3qw7NTxsmNr4RvN8= github.com/tevid/gohamcrest v1.1.1 h1:ou+xSqlIw1xfGTg1uq1nif/htZ2S3EzRqLm2BP+tYU0= github.com/tevid/gohamcrest v1.1.1/go.mod h1:3UvtWlqm8j5JbwYZh80D/PVBt0mJ1eJiYgZMibh0H/k= -github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7/go.mod h1:imsgLplxEC/etjIhdr3dNzV3JeT27LbVu5pYWm0JCBY= github.com/tinylib/msgp v1.1.0 h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU= github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc h1:yUaosFVTJwnltaHbSNC3i82I92quFs+OFPRl8kNMVwo= -github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3 h1:kF/7m/ZU+0D4Jj5eZ41Zm3IH/J8OElK1Qtd7tVKAwLk= github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3/go.mod h1:QDlpd3qS71vYtakd2hmdpqhJ9nwv6mD6A30bQ1BPBFE= -github.com/transip/gotransip v0.0.0-20190812104329-6d8d9179b66f/go.mod h1:i0f4R4o2HM0m3DZYQWsj6/MEowD57VzoH0v3d7igeFY= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926 h1:G3dpKMzFDjgEh2q1Z7zUUtKa8ViPtH+ocF0bE0g00O8= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/vmware/govmomi v0.18.0 h1:f7QxSmP7meCtoAmiKZogvVbLInT+CZx6Px6K5rYsJZo= github.com/vmware/govmomi v0.18.0/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= -github.com/vultr/govultr v0.1.4/go.mod h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA= github.com/willf/bitset v1.1.10 h1:NotGKqX0KwQ72NUzqrjZq5ipPNDQex9lo3WpaS8L2sc= github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= -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 v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zouyx/agollo/v3 v3.4.5 h1:7YCxzY9ZYaH9TuVUBvmI6Tk0mwMggikah+cfbYogcHQ= github.com/zouyx/agollo/v3 v3.4.5/go.mod h1:LJr3kDmm23QSW+F1Ol4TMHDa7HvJvscMdVxJ2IpUTVc= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= @@ -991,12 +802,10 @@ go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/ratelimit v0.0.0-20180316092928-c15da0234277/go.mod h1:2X8KaoNd1J0lZV+PxJk/5+DGbO/tpwLR1m++a7FnB/Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= @@ -1004,39 +813,26 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= -golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/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-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= -golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/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/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1046,7 +842,6 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= @@ -1054,11 +849,9 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCc golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180611182652-db08ff08e862/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1069,7 +862,6 @@ golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190228165749-92fc7df08ae7/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-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1078,22 +870,14 @@ golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191027093000-83d349e8ac1a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA= -golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= @@ -1104,11 +888,9 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180622082034-63fc586f45fe/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1121,7 +903,6 @@ golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/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-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1129,17 +910,14 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190508220229-2d0786266e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190523142557-0e01d883c5c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1148,34 +926,26 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201007082116-8445cc04cbdf/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211 h1:9UQO31fZ+0aKQOFldThf7BKPMJTiBfWycGh/u3UoO88= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201223074533-0d417f636930 h1:vRgIt+nup/B/BwIS0g2oC0haq0iqbV3ZA+u6+0TlNCo= +golang.org/x/sys v0.0.0-20201223074533-0d417f636930/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -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/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1199,16 +969,10 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200513154647-78b527d18275/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200928182047-19e03678916f h1:VwGa2Wf+rHGIxvsssCkUNIyFv8jQY0VCBCNWtikoWq0= golang.org/x/tools v0.0.0-20200928182047-19e03678916f/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1221,9 +985,8 @@ google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEt google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0 h1:Q3Ui3V3/CVinFWFiW39Iw0kMuVrRzYX0wN6OPFp0lTA= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0 h1:uMf5uLi4eQMRrMKhCplNik4U4H8Z6C1br3zOtAa/aDE= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1232,8 +995,8 @@ google.golang.org/appengine v1.6.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1241,9 +1004,8 @@ google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dT google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a h1:Ob5/580gVHBJZgXnff1cZDbG+xLtMVE5mDRTe+nIsX4= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 h1:aQktFqmDE2yjveXJlVIfslDFmFnUXSqG0i6KRcJAeMc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1256,7 +1018,6 @@ google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -1264,39 +1025,31 @@ google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ 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.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 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/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= -gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.44.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ns1/ns1-go.v2 v2.0.0-20190730140822-b51389932cbc/go.mod h1:VV+3haRsgDiVLxyifmMBrBIuCWFBPYKbRssXB9z67Hw= -gopkg.in/resty.v1 v1.9.1/go.mod h1:vo52Hzryw9PnPHcJfPsBiFW62XhNx5OczbV9y+IMpgc= gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= -gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/telegram-bot-api.v4 v4.6.4/go.mod h1:5DpGO5dbumb40px+dXcwCpcjmeHNYLpk0bp3XRNvWDM= +gopkg.in/square/go-jose.v2 v2.4.1 h1:H0TmLt7/KmzlrDOpa1F+zr0Tk90PbJYBfsVUmRLrf9Y= +gopkg.in/square/go-jose.v2 v2.4.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= 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/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= @@ -1311,7 +1064,6 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 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= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1319,6 +1071,7 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +istio.io/gogo-genproto v0.0.0-20190124151557-6d926a6e6feb/go.mod h1:eIDJ6jNk/IeJz6ODSksHl5Aiczy5JUq6vFhJWI5OtiI= k8s.io/api v0.16.9 h1:3vCx0WX9qcg1Hv4aQ/G1tiIKectGVuimvPVTJU4VOCA= k8s.io/api v0.16.9/go.mod h1:Y7dZNHs1Xy0mSwSlzL9QShi6qkljnN41yR8oWCRTDe8= k8s.io/apimachinery v0.16.9 h1:ESUZ4hMBUKF2kn2HBFL5zM/wQv4j/0uRbR7AjgqGJ4o= @@ -1333,7 +1086,6 @@ k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/utils v0.0.0-20190801114015-581e00157fb1 h1:+ySTxfHnfzZb9ys375PXNlLhkJPLKgHajBU0N62BDvE= k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= diff --git a/integrate_test.sh b/integrate_test.sh index deccda756a211821978e35b92a1f0865858ff59a..e1bbc8c11b0195f7cc4f08946d57464c88e74f19 100644 --- a/integrate_test.sh +++ b/integrate_test.sh @@ -26,12 +26,12 @@ ROOT_DIR=$(pwd) echo "integrate-test root work-space -> ${ROOT_DIR}" # show all travis-env -echo "travis current commit id -> ${TRAVIS_COMMIT}" -echo "travis pull request -> ${TRAVIS_PULL_REQUEST}" -echo "travis pull request branch -> ${TRAVIS_PULL_REQUEST_BRANCH}" -echo "travis pull request slug -> ${TRAVIS_PULL_REQUEST_SLUG}" -echo "travis pull request sha -> ${TRAVIS_PULL_REQUEST_SHA}" -echo "travis pull request repo slug -> ${TRAVIS_REPO_SLUG}" +echo "travis current commit id -> $2" +echo "travis pull request branch -> ${GITHUB_REF}" +echo "travis pull request slug -> ${GITHUB_REPOSITORY}" +echo "travis pull request repo slug -> ${GITHUB_REPOSITORY}" +echo "travis pull request actor -> ${GITHUB_ACTOR}" +echo "travis pull request repo param -> $1" # #start etcd registry insecure listen in [:]:2379 @@ -53,13 +53,13 @@ echo "zookeeper listen in [:]2181" # build go-server image cd ./test/integrate/dubbo/go-server -docker build . -t ci-provider --build-arg PR_ORIGIN_REPO=${TRAVIS_PULL_REQUEST_SLUG} --build-arg PR_ORIGIN_COMMITID=${TRAVIS_PULL_REQUEST_SHA} +docker build . -t ci-provider --build-arg PR_ORIGIN_REPO=$1 --build-arg PR_ORIGIN_COMMITID=$2 cd ${ROOT_DIR} docker run -d --network host ci-provider # build go-client image cd ./test/integrate/dubbo/go-client -docker build . -t ci-consumer --build-arg PR_ORIGIN_REPO=${TRAVIS_PULL_REQUEST_SLUG} --build-arg PR_ORIGIN_COMMITID=${TRAVIS_PULL_REQUEST_SHA} +docker build . -t ci-consumer --build-arg PR_ORIGIN_REPO=$1 --build-arg PR_ORIGIN_COMMITID=$2 cd ${ROOT_DIR} # run provider # check consumer status diff --git a/metadata/mapping/dynamic/service_name_mapping_test.go b/metadata/mapping/dynamic/service_name_mapping_test.go index 2896b0fd4aa4fb6bada132c276c70a1653e59f99..af21704b69c674a2cd1b8963bb252ac73c0abf1e 100644 --- a/metadata/mapping/dynamic/service_name_mapping_test.go +++ b/metadata/mapping/dynamic/service_name_mapping_test.go @@ -39,6 +39,7 @@ func TestDynamicConfigurationServiceNameMapping(t *testing.T) { dc, err := (&config_center.MockDynamicConfigurationFactory{ Content: appName, }).GetDynamicConfiguration(nil) + assert.NoError(t, err) config.GetApplicationConfig().Name = appName mapping := &DynamicConfigurationServiceNameMapping{dc: dc} diff --git a/metadata/report/consul/report_test.go b/metadata/report/consul/report_test.go index 13d0c419bc0f0ff8426f73d4de5c85a346416770..51e93179a21851f4a81039180ecdff7519ae36fe 100644 --- a/metadata/report/consul/report_test.go +++ b/metadata/report/consul/report_test.go @@ -143,7 +143,9 @@ func (suite *consulMetadataReportTestSuite) testGetServiceDefinition() { func test1(t *testing.T) { consulAgent := consul.NewConsulAgent(t, 8500) - defer consulAgent.Shutdown() + defer func() { + _ = consulAgent.Shutdown() + }() url := newProviderRegistryUrl("localhost", 8500) mf := extension.GetMetadataReportFactory("consul") diff --git a/metadata/report/delegate/delegate_report.go b/metadata/report/delegate/delegate_report.go index 836a8f9ef4aac23558e44c1c9c5adedd585d6da4..56a22de8f8e56c040260edf86859a4499f1b2f39 100644 --- a/metadata/report/delegate/delegate_report.go +++ b/metadata/report/delegate/delegate_report.go @@ -109,6 +109,10 @@ type MetadataReport struct { // NewMetadataReport will create a MetadataReport with initiation func NewMetadataReport() (*MetadataReport, error) { url := instance.GetMetadataReportUrl() + if url == nil { + logger.Warn("the metadataReport URL is not configured, you should configure it.") + return nil, perrors.New("the metadataReport URL is not configured, you should configure it.") + } bmr := &MetadataReport{ reportUrl: url, syncReport: url.GetParamBool(constant.SYNC_REPORT_KEY, false), @@ -220,7 +224,11 @@ func (mr *MetadataReport) SaveServiceMetadata(identifier *identifier.ServiceMeta if mr.syncReport { return report.SaveServiceMetadata(identifier, url) } - go report.SaveServiceMetadata(identifier, url) + go func() { + if err := report.SaveServiceMetadata(identifier, url); err != nil { + logger.Warnf("report.SaveServiceMetadata(identifier:%v, url:%v) = error:%v", identifier, url, err) + } + }() return nil } @@ -230,7 +238,11 @@ func (mr *MetadataReport) RemoveServiceMetadata(identifier *identifier.ServiceMe if mr.syncReport { return report.RemoveServiceMetadata(identifier) } - go report.RemoveServiceMetadata(identifier) + go func() { + if err := report.RemoveServiceMetadata(identifier); err != nil { + logger.Warnf("report.RemoveServiceMetadata(identifier:%v) = error:%v", identifier, err) + } + }() return nil } @@ -255,7 +267,12 @@ func (mr *MetadataReport) SaveSubscribedData(identifier *identifier.SubscriberMe if mr.syncReport { return report.SaveSubscribedData(identifier, string(bytes)) } - go report.SaveSubscribedData(identifier, string(bytes)) + go func() { + if err := report.SaveSubscribedData(identifier, string(bytes)); err != nil { + logger.Warnf("report.SaveSubscribedData(identifier:%v, string(bytes):%v) = error: %v", + identifier, string(bytes), err) + } + }() return nil } diff --git a/metadata/report/delegate/delegate_report_test.go b/metadata/report/delegate/delegate_report_test.go index 9c30ed9ffdb8424be38d273fd0a78f3351d6e0d5..f60acf6e117c866cba716c538806f278d77363f0 100644 --- a/metadata/report/delegate/delegate_report_test.go +++ b/metadata/report/delegate/delegate_report_test.go @@ -46,13 +46,10 @@ func TestMetadataReport_MetadataReportRetry(t *testing.T) { }) assert.NoError(t, err) retry.startRetryTask() - itsTime := time.After(2500 * time.Millisecond) - select { - case <-itsTime: - retry.scheduler.Clear() - assert.Equal(t, counter.Load(), int64(3)) - logger.Info("over") - } + <-time.After(2500 * time.Millisecond) + retry.scheduler.Clear() + assert.Equal(t, counter.Load(), int64(3)) + logger.Info("over") } func TestMetadataReport_MetadataReportRetryWithLimit(t *testing.T) { @@ -64,13 +61,10 @@ func TestMetadataReport_MetadataReportRetryWithLimit(t *testing.T) { }) assert.NoError(t, err) retry.startRetryTask() - itsTime := time.After(2500 * time.Millisecond) - select { - case <-itsTime: - retry.scheduler.Clear() - assert.Equal(t, counter.Load(), int64(2)) - logger.Info("over") - } + <-time.After(2500 * time.Millisecond) + retry.scheduler.Clear() + assert.Equal(t, counter.Load(), int64(2)) + logger.Info("over") } func mockNewMetadataReport(t *testing.T) *MetadataReport { diff --git a/metadata/report/etcd/report_test.go b/metadata/report/etcd/report_test.go index 28c04869822b166f99d98e91ec6ec3b7fe6626cc..59d0975ca675ef9550d3b2669a24ebd70ce94ec0 100644 --- a/metadata/report/etcd/report_test.go +++ b/metadata/report/etcd/report_test.go @@ -82,8 +82,9 @@ func TestEtcdMetadataReport_CRUD(t *testing.T) { assert.Nil(t, err) serviceMi := newServiceMetadataIdentifier() - serviceUrl, _ := common.NewURL("registry://localhost:8848", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) - metadataReport.SaveServiceMetadata(serviceMi, serviceUrl) + serviceUrl, err := common.NewURL("registry://localhost:8848", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) + assert.Nil(t, err) + err = metadataReport.SaveServiceMetadata(serviceMi, serviceUrl) assert.Nil(t, err) subMi := newSubscribeMetadataIdentifier() diff --git a/metadata/report/nacos/report_test.go b/metadata/report/nacos/report_test.go index b40b4380dbf8339277436b77d26d9ee3ab728a21..1b7075ec78e4ac496983564b684d8776e1476b63 100644 --- a/metadata/report/nacos/report_test.go +++ b/metadata/report/nacos/report_test.go @@ -19,8 +19,10 @@ package nacos import ( "encoding/json" + "net/http" "strconv" "testing" + "time" ) import ( @@ -36,6 +38,9 @@ import ( ) func TestNacosMetadataReport_CRUD(t *testing.T) { + if !checkNacosServerAlive() { + return + } rpt := newTestReport() assert.NotNil(t, rpt) @@ -114,3 +119,11 @@ func newTestReport() report.MetadataReport { res := extension.GetMetadataReportFactory("nacos").CreateMetadataReport(regurl) return res } + +func checkNacosServerAlive() bool { + c := http.Client{Timeout: time.Second} + if _, err := c.Get("http://console.nacos.io/nacos/"); err != nil { + return false + } + return true +} diff --git a/metadata/report/zookeeper/report_test.go b/metadata/report/zookeeper/report_test.go index adedaaa6f4bd71511385085118f55538a5deb091..3f927b1af7ae30ac3dc4af3743e38dba00bb0ae9 100644 --- a/metadata/report/zookeeper/report_test.go +++ b/metadata/report/zookeeper/report_test.go @@ -144,7 +144,10 @@ func (suite *zookeeperMetadataReportTestSuite) testGetServiceDefinition() { func test1(t *testing.T) { testCluster, err := zk.StartTestCluster(1, nil, nil) assert.NoError(t, err) - defer testCluster.Stop() + defer func() { + err := testCluster.Stop() + assert.Nil(t, err) + }() url := newProviderRegistryUrl("127.0.0.1", testCluster.Servers[0].Port) mf := extension.GetMetadataReportFactory("zookeeper") diff --git a/metadata/service/inmemory/service_proxy.go b/metadata/service/inmemory/service_proxy.go index 7e14293a6766492c1c1b02eef9429d1adeb539ae..8b93aab9accfd8375ded971c27f898069e73e231 100644 --- a/metadata/service/inmemory/service_proxy.go +++ b/metadata/service/inmemory/service_proxy.go @@ -39,8 +39,8 @@ import ( // this is the stub, or proxy // for now, only GetExportedURLs need to be implemented type MetadataServiceProxy struct { - invkr protocol.Invoker - golangServer bool + invkr protocol.Invoker + //golangServer bool } func (m *MetadataServiceProxy) GetExportedURLs(serviceInterface string, group string, version string, protocol string) ([]interface{}, error) { @@ -67,11 +67,7 @@ func (m *MetadataServiceProxy) GetExportedURLs(serviceInterface string, group st urlStrs := res.Result().(*[]interface{}) ret := make([]interface{}, 0, len(*urlStrs)) - - for _, s := range *urlStrs { - ret = append(ret, s) - } - return ret, nil + return append(ret, *urlStrs...), nil } func (m *MetadataServiceProxy) MethodMapper() map[string]string { diff --git a/metadata/service/inmemory/service_proxy_test.go b/metadata/service/inmemory/service_proxy_test.go index f7fc8fd88e5f31804253dc996cb99b241a519d14..9278fd9d6cf1b4657d35028aa8c244fdbc16d106 100644 --- a/metadata/service/inmemory/service_proxy_test.go +++ b/metadata/service/inmemory/service_proxy_test.go @@ -48,19 +48,33 @@ func TestMetadataServiceProxy_GetExportedURLs(t *testing.T) { // when we implement them, adding UT func TestNewMetadataService(t *testing.T) { pxy := createPxy() - pxy.ServiceName() - pxy.PublishServiceDefinition(&common.URL{}) - pxy.GetServiceDefinition(constant.ANY_VALUE, constant.ANY_VALUE, constant.ANY_VALUE) - pxy.Version() - pxy.GetSubscribedURLs() - pxy.UnsubscribeURL(&common.URL{}) - pxy.GetServiceDefinitionByServiceKey("any") - pxy.ExportURL(&common.URL{}) - pxy.SubscribeURL(&common.URL{}) - pxy.MethodMapper() - pxy.UnexportURL(&common.URL{}) - pxy.RefreshMetadata(constant.ANY_VALUE, constant.ANY_VALUE) - + _, err := pxy.ServiceName() + assert.Nil(t, err) + err = pxy.PublishServiceDefinition(&common.URL{}) + assert.Nil(t, err) + _, err = pxy.GetServiceDefinition(constant.ANY_VALUE, constant.ANY_VALUE, constant.ANY_VALUE) + assert.Nil(t, err) + _, err = pxy.Version() + assert.Nil(t, err) + _, err = pxy.GetSubscribedURLs() + assert.Nil(t, err) + err = pxy.UnsubscribeURL(&common.URL{}) + assert.Nil(t, err) + _, err = pxy.GetServiceDefinitionByServiceKey("any") + assert.Nil(t, err) + ok, err := pxy.ExportURL(&common.URL{}) + assert.False(t, ok) + assert.NoError(t, err) + ok, err = pxy.SubscribeURL(&common.URL{}) + assert.False(t, ok) + assert.NoError(t, err) + m := pxy.MethodMapper() + assert.True(t, len(m) == 0) + err = pxy.UnexportURL(&common.URL{}) + assert.NoError(t, err) + ok, err = pxy.RefreshMetadata(constant.ANY_VALUE, constant.ANY_VALUE) + assert.False(t, ok) + assert.NoError(t, err) } func createPxy() service.MetadataService { diff --git a/metadata/service/inmemory/service_test.go b/metadata/service/inmemory/service_test.go index 256412c2917d39c0ff15db11121718ba983cd7ab..e50cd6208a4d86f8238cc68538493c309870c455 100644 --- a/metadata/service/inmemory/service_test.go +++ b/metadata/service/inmemory/service_test.go @@ -46,7 +46,9 @@ func TestMetadataService(t *testing.T) { "owner=ZX&pid=1447&revision=0.0.1&side=provider&timeout=3000×tamp=1556509797245&group=%v&version=%v&bean.name=%v", protocol, serviceName, group, version, beanName)) assert.NoError(t, err) - mts.ExportURL(u2) + ok, err := mts.ExportURL(u2) + assert.True(t, ok) + assert.NoError(t, err) u3, err := common.NewURL(fmt.Sprintf( "%v://127.0.0.1:20000/com.ikurento.user.UserProvider3?anyhost=true&"+ @@ -55,7 +57,9 @@ func TestMetadataService(t *testing.T) { "owner=ZX&pid=1447&revision=0.0.1&side=provider&timeout=3000×tamp=1556509797245&group=%v&version=%v&bean.name=%v", protocol, serviceName, group, version, beanName)) assert.NoError(t, err) - mts.ExportURL(u3) + ok, err = mts.ExportURL(u3) + assert.True(t, ok) + assert.NoError(t, err) u, err := common.NewURL(fmt.Sprintf( "%v://127.0.0.1:20000/com.ikurento.user.UserProvider1?anyhost=true&"+ @@ -64,32 +68,45 @@ func TestMetadataService(t *testing.T) { "owner=ZX&pid=1447&revision=0.0.1&side=provider&timeout=3000×tamp=1556509797245&group=%v&version=%v&bean.name=%v", protocol, serviceName, group, version, beanName)) assert.NoError(t, err) - mts.ExportURL(u) + ok, err = mts.ExportURL(u) + assert.True(t, ok) + assert.NoError(t, err) list, _ := mts.GetExportedURLs(serviceName, group, version, protocol) assert.Equal(t, 3, len(list)) - mts.SubscribeURL(u) + ok, err = mts.SubscribeURL(u) + assert.True(t, ok) + assert.NoError(t, err) - mts.SubscribeURL(u) - list2, _ := mts.GetSubscribedURLs() + ok, err = mts.SubscribeURL(u) + assert.False(t, ok) + assert.NoError(t, err) + list2, err := mts.GetSubscribedURLs() assert.Equal(t, 1, len(list2)) + assert.NoError(t, err) - mts.UnexportURL(u) + err = mts.UnexportURL(u) + assert.NoError(t, err) list3, _ := mts.GetExportedURLs(serviceName, group, version, protocol) assert.Equal(t, 2, len(list3)) - mts.UnsubscribeURL(u) + err = mts.UnsubscribeURL(u) + assert.NoError(t, err) list4, _ := mts.GetSubscribedURLs() assert.Equal(t, 0, len(list4)) userProvider := &definition.UserProvider{} - common.ServiceMap.Register(serviceName, protocol, group, version, userProvider) - mts.PublishServiceDefinition(u) + _, err = common.ServiceMap.Register(serviceName, protocol, group, version, userProvider) + assert.NoError(t, err) + err = mts.PublishServiceDefinition(u) + assert.NoError(t, err) expected := "{\"CanonicalName\":\"com.ikurento.user.UserProvider\",\"CodeSource\":\"\"," + "\"Methods\":[{\"Name\":\"GetUser\",\"ParameterTypes\":[\"slice\"],\"ReturnType\":\"ptr\"," + "\"Parameters\":null}],\"Types\":null}" - def1, _ := mts.GetServiceDefinition(serviceName, group, version) + def1, err := mts.GetServiceDefinition(serviceName, group, version) assert.Equal(t, expected, def1) + assert.NoError(t, err) serviceKey := definition.ServiceDescriperBuild(serviceName, group, version) - def2, _ := mts.GetServiceDefinitionByServiceKey(serviceKey) + def2, err := mts.GetServiceDefinitionByServiceKey(serviceKey) assert.Equal(t, expected, def2) + assert.NoError(t, err) } diff --git a/metadata/service/remote/service.go b/metadata/service/remote/service.go index efd16bdc6dad555f5a99bc4b2a02ee2a08202537..bb520d3df72c369eb4022246f20bb9e9aa1bd8b8 100644 --- a/metadata/service/remote/service.go +++ b/metadata/service/remote/service.go @@ -107,29 +107,49 @@ func (mts *MetadataService) SubscribeURL(url *common.URL) (bool, error) { // UnsubscribeURL will be implemented by in memory service func (mts *MetadataService) UnsubscribeURL(url *common.URL) error { - return mts.UnsubscribeURL(url) + // TODO remove call self. + return nil + //return mts.UnsubscribeURL(url) } // PublishServiceDefinition will call remote metadata's StoreProviderMetadata to store url info and service definition func (mts *MetadataService) PublishServiceDefinition(url *common.URL) error { interfaceName := url.GetParam(constant.INTERFACE_KEY, "") isGeneric := url.GetParamBool(constant.GENERIC_KEY, false) - if len(interfaceName) > 0 && !isGeneric { - sv := common.ServiceMap.GetServiceByServiceKey(url.Protocol, url.ServiceKey()) - sd := definition.BuildServiceDefinition(*sv, url) + if common.RoleType(common.PROVIDER).Role() == url.GetParam(constant.SIDE_KEY, "") { + if len(interfaceName) > 0 && !isGeneric { + sv := common.ServiceMap.GetServiceByServiceKey(url.Protocol, url.ServiceKey()) + sd := definition.BuildServiceDefinition(*sv, url) + id := &identifier.MetadataIdentifier{ + BaseMetadataIdentifier: identifier.BaseMetadataIdentifier{ + ServiceInterface: interfaceName, + Version: url.GetParam(constant.VERSION_KEY, ""), + Group: url.GetParam(constant.GROUP_KEY, constant.DUBBO), + Side: url.GetParam(constant.SIDE_KEY, constant.PROVIDER_PROTOCOL), + }, + } + mts.delegateReport.StoreProviderMetadata(id, sd) + return nil + } + logger.Errorf("publishProvider interfaceName is empty . providerUrl:%v ", url) + } else { + params := make(map[string]string, len(url.GetParams())) + url.RangeParams(func(key, value string) bool { + params[key] = value + return true + }) id := &identifier.MetadataIdentifier{ BaseMetadataIdentifier: identifier.BaseMetadataIdentifier{ ServiceInterface: interfaceName, Version: url.GetParam(constant.VERSION_KEY, ""), - // Group: url.GetParam(constant.GROUP_KEY, constant.SERVICE_DISCOVERY_DEFAULT_GROUP), - Group: url.GetParam(constant.GROUP_KEY, constant.DUBBO), - Side: url.GetParam(constant.SIDE_KEY, "provider"), + Group: url.GetParam(constant.GROUP_KEY, constant.DUBBO), + Side: url.GetParam(constant.SIDE_KEY, "consumer"), }, } - mts.delegateReport.StoreProviderMetadata(id, sd) + mts.delegateReport.StoreConsumerMetadata(id, params) return nil } - logger.Errorf("publishProvider interfaceName is empty . providerUrl:%v ", url) + return nil } @@ -186,7 +206,7 @@ func (mts *MetadataService) RefreshMetadata(exportedRevision string, subscribedR logger.Errorf("Error occur when execute remote.MetadataService.RefreshMetadata, error message is %v+", err) return false, err } - if urls != nil && len(urls) > 0 { + if len(urls) > 0 { id := &identifier.SubscriberMetadataIdentifier{ MetadataIdentifier: identifier.MetadataIdentifier{ Application: config.GetApplicationConfig().Name, diff --git a/metadata/service/remote/service_proxy.go b/metadata/service/remote/service_proxy.go index a89a0a1521ea8a2aea297c465c823db0e425fae9..e0cd6e0783fe4572e0a69cf0694d70f74ba46b42 100644 --- a/metadata/service/remote/service_proxy.go +++ b/metadata/service/remote/service_proxy.go @@ -146,7 +146,7 @@ func newMetadataServiceProxy(ins registry.ServiceInstance) service.MetadataServi } func parse(key string) []string { - arr := make([]string, 3, 3) + arr := make([]string, 3) tmp := strings.SplitN(key, "/", 2) if len(tmp) > 1 { arr[0] = tmp[0] diff --git a/metadata/service/remote/service_proxy_test.go b/metadata/service/remote/service_proxy_test.go index 8bccbb8bbb70d1533fa3dad78bab59e82ff2e5b3..1899d02205e17f62637488e68630649e60cff061 100644 --- a/metadata/service/remote/service_proxy_test.go +++ b/metadata/service/remote/service_proxy_test.go @@ -54,18 +54,28 @@ func TestMetadataServiceProxy_GetServiceDefinition(t *testing.T) { // in fact, we don't use them func TestMetadataServiceProxy(t *testing.T) { pxy := createProxy() - pxy.ServiceName() - pxy.PublishServiceDefinition(&common.URL{}) - pxy.Version() - pxy.GetSubscribedURLs() - pxy.UnsubscribeURL(&common.URL{}) - pxy.GetServiceDefinitionByServiceKey("any") - pxy.ExportURL(&common.URL{}) - pxy.SubscribeURL(&common.URL{}) - pxy.MethodMapper() - pxy.UnexportURL(&common.URL{}) - pxy.Reference() - pxy.RefreshMetadata(constant.ANY_VALUE, constant.ANY_VALUE) + _, err := pxy.ServiceName() + assert.NoError(t, err) + err = pxy.PublishServiceDefinition(&common.URL{}) + assert.NoError(t, err) + _, err = pxy.Version() + assert.NoError(t, err) + _, err = pxy.GetSubscribedURLs() + assert.NoError(t, err) + err = pxy.UnsubscribeURL(&common.URL{}) + assert.NoError(t, err) + _, err = pxy.GetServiceDefinitionByServiceKey("any") + assert.NoError(t, err) + _, err = pxy.ExportURL(&common.URL{}) + assert.NoError(t, err) + _, err = pxy.SubscribeURL(&common.URL{}) + assert.NoError(t, err) + _ = pxy.MethodMapper() + err = pxy.UnexportURL(&common.URL{}) + assert.NoError(t, err) + _ = pxy.Reference() + _, err = pxy.RefreshMetadata(constant.ANY_VALUE, constant.ANY_VALUE) + assert.NoError(t, err) } func createProxy() service.MetadataService { diff --git a/metadata/service/remote/service_test.go b/metadata/service/remote/service_test.go index 71586cc1dcc87dc8644a25c9a89842bd84fe9f0a..d6028152ccb275238491accc055e67d0b903bc55 100644 --- a/metadata/service/remote/service_test.go +++ b/metadata/service/remote/service_test.go @@ -95,7 +95,7 @@ func (metadataReport) GetServiceDefinition(*identifier.MetadataIdentifier) (stri func TestMetadataService(t *testing.T) { extension.SetMetadataReportFactory("mock", getMetadataReportFactory) - u, err := common.NewURL(fmt.Sprintf("mock://127.0.0.1:20000/?sync.report=true")) + u, err := common.NewURL("mock://127.0.0.1:20000/?sync.report=true") assert.NoError(t, err) instance.GetMetadataReportInstance(u) mts, err := newMetadataService() diff --git a/metrics/prometheus/reporter.go b/metrics/prometheus/reporter.go index 810a13d87ce938a3b8a9d085f6d5ae6e3dc4c6ad..266c8206c5ea5b6dc07402943bcebdeb6dd7dea7 100644 --- a/metrics/prometheus/reporter.go +++ b/metrics/prometheus/reporter.go @@ -24,6 +24,7 @@ import ( "sync" "time" ) + import ( "github.com/prometheus/client_golang/prometheus" ) @@ -64,7 +65,6 @@ var ( // should initialize after loading configuration func init() { - extension.SetMetricReporter(reporterName, newPrometheusReporter) } @@ -72,12 +72,10 @@ func init() { // if you want to use this feature, you need to initialize your prometheus. // https://prometheus.io/docs/guides/go-application/ type PrometheusReporter struct { - // report the consumer-side's summary data consumerSummaryVec *prometheus.SummaryVec // report the provider-side's summary data providerSummaryVec *prometheus.SummaryVec - // report the provider-side's histogram data providerHistogramVec *prometheus.HistogramVec // report the consumer-side's histogram data diff --git a/metrics/prometheus/reporter_test.go b/metrics/prometheus/reporter_test.go index eaba0e324ff078bdfb2fd4b146ac9ea60d429724..1b9853f4d20739269861aac680b1ec491ef552d6 100644 --- a/metrics/prometheus/reporter_test.go +++ b/metrics/prometheus/reporter_test.go @@ -26,6 +26,7 @@ import ( import ( "github.com/stretchr/testify/assert" ) + import ( "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/extension" diff --git a/metrics/reporter.go b/metrics/reporter.go index 9a7094fa62d9c0fa3e6ee0a8ef373f91c28d2c90..24d75aa4fe949737d7ca94cfd339a32af14a40be 100644 --- a/metrics/reporter.go +++ b/metrics/reporter.go @@ -21,6 +21,7 @@ import ( "context" "time" ) + import ( "github.com/apache/dubbo-go/protocol" ) diff --git a/protocol/dubbo/dubbo_codec.go b/protocol/dubbo/dubbo_codec.go index 5e859a7fa2254ba0e4806bc60c037c47777bc641..21376c3145d7d620d7fc12f2bc67efcd65faee4b 100644 --- a/protocol/dubbo/dubbo_codec.go +++ b/protocol/dubbo/dubbo_codec.go @@ -105,7 +105,7 @@ func (c *DubboCodec) EncodeRequest(request *remoting.Request) (*bytes.Buffer, er return pkg.Marshal() } -// encode heartbeart request +// encode heartbeat request func (c *DubboCodec) encodeHeartbeartReqeust(request *remoting.Request) (*bytes.Buffer, error) { header := impl.DubboHeader{ Type: impl.PackageHeartbeat, @@ -177,10 +177,7 @@ func (c *DubboCodec) Decode(data []byte) (remoting.DecodeResult, int, error) { } func (c *DubboCodec) isRequest(data []byte) bool { - if data[2]&byte(0x80) == 0x00 { - return false - } - return true + return data[2]&byte(0x80) != 0x00 } // decode request @@ -238,7 +235,6 @@ func (c *DubboCodec) decodeRequest(data []byte) (*remoting.Request, int, error) func (c *DubboCodec) decodeResponse(data []byte) (*remoting.Response, int, error) { buf := bytes.NewBuffer(data) pkg := impl.NewDubboPackage(buf) - response := &remoting.Response{} err := pkg.Unmarshal() if err != nil { originErr := perrors.Cause(err) @@ -250,7 +246,7 @@ func (c *DubboCodec) decodeResponse(data []byte) (*remoting.Response, int, error return nil, 0, perrors.WithStack(err) } - response = &remoting.Response{ + response := &remoting.Response{ ID: pkg.Header.ID, //Version: pkg.Header., SerialID: pkg.Header.SerialID, diff --git a/protocol/dubbo/dubbo_invoker_test.go b/protocol/dubbo/dubbo_invoker_test.go index c7a9a2697529d096e57585347b0a8b0a535451b0..fecb3b01ab286d4900cba4628cb80ea6d9920a9a 100644 --- a/protocol/dubbo/dubbo_invoker_test.go +++ b/protocol/dubbo/dubbo_invoker_test.go @@ -169,7 +169,7 @@ type ( } UserProvider struct { - user map[string]User + //user map[string]User } ) diff --git a/protocol/dubbo/dubbo_protocol.go b/protocol/dubbo/dubbo_protocol.go index 4f03b8aba061ea9b37b35d89142eb7bec80f3a97..1f7cd50187d14252ec7e4b2f5c78e8b5bd9228e2 100644 --- a/protocol/dubbo/dubbo_protocol.go +++ b/protocol/dubbo/dubbo_protocol.go @@ -222,13 +222,13 @@ func getExchangeClient(url *common.URL) *remoting.ExchangeClient { // Once we decided to transfer more context's key-value, we should change this. // now we only support rebuild the tracing context func rebuildCtx(inv *invocation.RPCInvocation) context.Context { - ctx := context.WithValue(context.Background(), "attachment", inv.Attachments()) + ctx := context.WithValue(context.Background(), constant.DubboCtxKey("attachment"), inv.Attachments()) // actually, if user do not use any opentracing framework, the err will not be nil. spanCtx, err := opentracing.GlobalTracer().Extract(opentracing.TextMap, opentracing.TextMapCarrier(filterContext(inv.Attachments()))) if err == nil { - ctx = context.WithValue(ctx, constant.TRACING_REMOTE_SPAN_CTX, spanCtx) + ctx = context.WithValue(ctx, constant.DubboCtxKey(constant.TRACING_REMOTE_SPAN_CTX), spanCtx) } return ctx } diff --git a/protocol/dubbo/hessian2/const.go b/protocol/dubbo/hessian2/const.go index 74a00b601db22397916aab215ccd33bc918d91e7..96e6eea8ea4cd3088e0d32157c013e93a93cad4e 100644 --- a/protocol/dubbo/hessian2/const.go +++ b/protocol/dubbo/hessian2/const.go @@ -28,11 +28,6 @@ import ( perrors "github.com/pkg/errors" ) -const ( - mask = byte(127) - flag = byte(128) -) - const ( // Zero : byte zero Zero = byte(0x00) @@ -80,14 +75,10 @@ const ( INT_SHORT_MAX = 0x3ffff BC_INT_SHORT_ZERO = byte(0xd4) - BC_LIST_VARIABLE = byte(0x55) - BC_LIST_FIXED = byte('V') - BC_LIST_VARIABLE_UNTYPED = byte(0x57) - BC_LIST_FIXED_UNTYPED = byte(0x58) - _listFixedTypedLenTagMin = byte(0x70) - _listFixedTypedLenTagMax = byte(0x77) - _listFixedUntypedLenTagMin = byte(0x78) - _listFixedUntypedLenTagMax = byte(0x7f) + BC_LIST_VARIABLE = byte(0x55) + BC_LIST_FIXED = byte('V') + BC_LIST_VARIABLE_UNTYPED = byte(0x57) + BC_LIST_FIXED_UNTYPED = byte(0x58) BC_LIST_DIRECT = byte(0x70) BC_LIST_DIRECT_UNTYPED = byte(0x78) diff --git a/protocol/dubbo/hessian2/hessian_dubbo.go b/protocol/dubbo/hessian2/hessian_dubbo.go index 1afa4ec96eccbb8077852dfcc020e0eb05be3257..5ffebde54b951997057a1f161dbcf6aae1d4a7fd 100644 --- a/protocol/dubbo/hessian2/hessian_dubbo.go +++ b/protocol/dubbo/hessian2/hessian_dubbo.go @@ -99,7 +99,7 @@ func (h *HessianCodec) Write(service Service, header DubboHeader, body interface return packResponse(header, body) default: - return nil, perrors.Errorf("Unrecognised message type: %v", header.Type) + return nil, perrors.Errorf("Unrecognized message type: %v", header.Type) } // unreachable return nil, nil @@ -190,9 +190,9 @@ func (h *HessianCodec) ReadBody(rspObj interface{}) error { switch h.pkgType & PackageType_BitSize { case PackageResponse | PackageHeartbeat | PackageResponse_Exception, PackageResponse | PackageResponse_Exception: decoder := hessian.NewDecoder(buf[:]) - exception, err := decoder.Decode() - if err != nil { - return perrors.WithStack(err) + exception, exceptionErr := decoder.Decode() + if exceptionErr != nil { + return perrors.WithStack(exceptionErr) } rsp, ok := rspObj.(*DubboResponse) if !ok { diff --git a/protocol/dubbo/hessian2/hessian_dubbo_test.go b/protocol/dubbo/hessian2/hessian_dubbo_test.go index 13dab92ba874fb5d746c5d57134592865cbfc7bd..eaaf500738e6c77142b0c0cb267fb0d8e7ac1437 100644 --- a/protocol/dubbo/hessian2/hessian_dubbo_test.go +++ b/protocol/dubbo/hessian2/hessian_dubbo_test.go @@ -80,6 +80,7 @@ func doTestHessianEncodeHeader(t *testing.T, packageType PackageType, responseSt func doTestResponse(t *testing.T, packageType PackageType, responseStatus byte, body interface{}, decodedResponse *DubboResponse, assertFunc func()) { resp, err := doTestHessianEncodeHeader(t, packageType, responseStatus, body) + assert.NoError(t, err) codecR := NewHessianCodec(bufio.NewReader(bytes.NewReader(resp))) @@ -163,6 +164,7 @@ func TestResponse(t *testing.T) { func doTestRequest(t *testing.T, packageType PackageType, responseStatus byte, body interface{}) { resp, err := doTestHessianEncodeHeader(t, packageType, responseStatus, body) + assert.NoError(t, err) codecR := NewHessianCodec(bufio.NewReader(bytes.NewReader(resp))) diff --git a/protocol/dubbo/hessian2/hessian_request.go b/protocol/dubbo/hessian2/hessian_request.go index 4ebb4aa1be05d4d1941661fed452dda06cf55fa0..94aa34dee895bc8d441f710edecabe0326da1400 100644 --- a/protocol/dubbo/hessian2/hessian_request.go +++ b/protocol/dubbo/hessian2/hessian_request.go @@ -30,6 +30,10 @@ import ( perrors "github.com/pkg/errors" ) +import ( + "github.com/apache/dubbo-go/common/logger" +) + ///////////////////////////////////////// // dubbo ///////////////////////////////////////// @@ -39,7 +43,7 @@ func getArgType(v interface{}) string { return "V" } - switch v.(type) { + switch v := v.(type) { // Serialized tags for base types case nil: return "V" @@ -216,23 +220,31 @@ func packRequest(service Service, header DubboHeader, req interface{}) ([]byte, // body ////////////////////////////////////////// if hb { - encoder.Encode(nil) + _ = encoder.Encode(nil) goto END } // dubbo version + path + version + method - encoder.Encode(DEFAULT_DUBBO_PROTOCOL_VERSION) - encoder.Encode(service.Path) - encoder.Encode(service.Version) - encoder.Encode(service.Method) + if err = encoder.Encode(DEFAULT_DUBBO_PROTOCOL_VERSION); err != nil { + logger.Warnf("Encode(DEFAULT_DUBBO_PROTOCOL_VERSION) = error: %v", err) + } + if err = encoder.Encode(service.Path); err != nil { + logger.Warnf("Encode(service.Path) = error: %v", err) + } + if err = encoder.Encode(service.Version); err != nil { + logger.Warnf("Encode(service.Version) = error: %v", err) + } + if err = encoder.Encode(service.Method); err != nil { + logger.Warnf("Encode(service.Method) = error: %v", err) + } // args = args type list + args value list if types, err = getArgsTypeList(args); err != nil { return nil, perrors.Wrapf(err, " PackRequest(args:%+v)", args) } - encoder.Encode(types) + _ = encoder.Encode(types) for _, v := range args { - encoder.Encode(v) + _ = encoder.Encode(v) } request.Attachments[PATH_KEY] = service.Path @@ -247,7 +259,7 @@ func packRequest(service Service, header DubboHeader, req interface{}) ([]byte, request.Attachments[TIMEOUT_KEY] = strconv.Itoa(int(service.Timeout / time.Millisecond)) } - encoder.Encode(request.Attachments) + _ = encoder.Encode(request.Attachments) END: byteArray = encoder.Buffer() diff --git a/protocol/dubbo/hessian2/hessian_response.go b/protocol/dubbo/hessian2/hessian_response.go index 982960ed87e74b325687ac364c97a347efe6c38f..b95e1c2711e8922b280260035eaba1cc03f50aa4 100644 --- a/protocol/dubbo/hessian2/hessian_response.go +++ b/protocol/dubbo/hessian2/hessian_response.go @@ -18,6 +18,7 @@ package hessian2 import ( "encoding/binary" + "github.com/apache/dubbo-go/common/logger" "math" "reflect" "strconv" @@ -93,7 +94,9 @@ func packResponse(header DubboHeader, ret interface{}) ([]byte, error) { if header.ResponseStatus == Response_OK { if hb { - encoder.Encode(nil) + if err := encoder.Encode(nil); err != nil { + logger.Warnf("Encode(nil) = %v", err) + } } else { atta := isSupportResponseAttachment(response.Attachments[DUBBO_VERSION_KEY]) @@ -109,30 +112,30 @@ func packResponse(header DubboHeader, ret interface{}) ([]byte, error) { } if response.Exception != nil { // throw error - encoder.Encode(resWithException) + _ = encoder.Encode(resWithException) if t, ok := response.Exception.(java_exception.Throwabler); ok { - encoder.Encode(t) + _ = encoder.Encode(t) } else { - encoder.Encode(java_exception.NewThrowable(response.Exception.Error())) + _ = encoder.Encode(java_exception.NewThrowable(response.Exception.Error())) } } else { if response.RspObj == nil { - encoder.Encode(resNullValue) + _ = encoder.Encode(resNullValue) } else { - encoder.Encode(resValue) - encoder.Encode(response.RspObj) // result + _ = encoder.Encode(resValue) + _ = encoder.Encode(response.RspObj) // result } } if atta { - encoder.Encode(response.Attachments) // attachments + _ = encoder.Encode(response.Attachments) // attachments } } } else { if response.Exception != nil { // throw error - encoder.Encode(response.Exception.Error()) + _ = encoder.Encode(response.Exception.Error()) } else { - encoder.Encode(response.RspObj) + _ = encoder.Encode(response.RspObj) } } @@ -145,7 +148,6 @@ func packResponse(header DubboHeader, ret interface{}) ([]byte, error) { // byteArray{body length} binary.BigEndian.PutUint32(byteArray[12:], uint32(pkgLen-HEADER_LENGTH)) return byteArray, nil - } // hessian decode response body diff --git a/protocol/dubbo/impl/codec.go b/protocol/dubbo/impl/codec.go index 17e7b57b45f2334e06b757ee07e3a9ef034c920a..6c9816f0ff9a4faee7750d16468fa65b9aa803f2 100644 --- a/protocol/dubbo/impl/codec.go +++ b/protocol/dubbo/impl/codec.go @@ -146,7 +146,7 @@ func (c *ProtocolCodec) Encode(p DubboPackage) ([]byte, error) { return packResponse(p, c.serializer) default: - return nil, perrors.Errorf("Unrecognised message type: %v", header.Type) + return nil, perrors.Errorf("Unrecognized message type: %v", header.Type) } } diff --git a/protocol/dubbo/impl/const.go b/protocol/dubbo/impl/const.go index 70d8bae6cad63d436f5d9f1ef69c397ee8a052f3..c9b92bad3b402f6f8656ca47c1a2954c7881d68b 100644 --- a/protocol/dubbo/impl/const.go +++ b/protocol/dubbo/impl/const.go @@ -28,11 +28,6 @@ const ( DUBBO = "dubbo" ) -const ( - mask = byte(127) - flag = byte(128) -) - const ( // Zero : byte zero Zero = byte(0x00) @@ -80,14 +75,10 @@ const ( INT_SHORT_MAX = 0x3ffff BC_INT_SHORT_ZERO = byte(0xd4) - BC_LIST_VARIABLE = byte(0x55) - BC_LIST_FIXED = byte('V') - BC_LIST_VARIABLE_UNTYPED = byte(0x57) - BC_LIST_FIXED_UNTYPED = byte(0x58) - _listFixedTypedLenTagMin = byte(0x70) - _listFixedTypedLenTagMax = byte(0x77) - _listFixedUntypedLenTagMin = byte(0x78) - _listFixedUntypedLenTagMax = byte(0x7f) + BC_LIST_VARIABLE = byte(0x55) + BC_LIST_FIXED = byte('V') + BC_LIST_VARIABLE_UNTYPED = byte(0x57) + BC_LIST_FIXED_UNTYPED = byte(0x58) BC_LIST_DIRECT = byte(0x70) BC_LIST_DIRECT_UNTYPED = byte(0x78) diff --git a/protocol/dubbo/impl/hessian.go b/protocol/dubbo/impl/hessian.go index 5fa1f2ece337e268c4907465bdc69ced76641ce7..e355276c37f9d1babc12f7e3b694ec7a193aed80 100644 --- a/protocol/dubbo/impl/hessian.go +++ b/protocol/dubbo/impl/hessian.go @@ -63,7 +63,7 @@ func marshalResponse(encoder *hessian.Encoder, p DubboPackage) ([]byte, error) { response := EnsureResponsePayload(p.Body) if header.ResponseStatus == Response_OK { if p.IsHeartBeat() { - encoder.Encode(nil) + _ = encoder.Encode(nil) } else { var version string if attachmentVersion, ok := response.Attachments[DUBBO_VERSION_KEY]; ok { @@ -83,30 +83,30 @@ func marshalResponse(encoder *hessian.Encoder, p DubboPackage) ([]byte, error) { } if response.Exception != nil { // throw error - encoder.Encode(resWithException) + _ = encoder.Encode(resWithException) if t, ok := response.Exception.(java_exception.Throwabler); ok { - encoder.Encode(t) + _ = encoder.Encode(t) } else { - encoder.Encode(java_exception.NewThrowable(response.Exception.Error())) + _ = encoder.Encode(java_exception.NewThrowable(response.Exception.Error())) } } else { if response.RspObj == nil { - encoder.Encode(resNullValue) + _ = encoder.Encode(resNullValue) } else { - encoder.Encode(resValue) - encoder.Encode(response.RspObj) // result + _ = encoder.Encode(resValue) + _ = encoder.Encode(response.RspObj) // result } } if atta { - encoder.Encode(response.Attachments) // attachments + _ = encoder.Encode(response.Attachments) // attachments } } } else { if response.Exception != nil { // throw error - encoder.Encode(response.Exception.Error()) + _ = encoder.Encode(response.Exception.Error()) } else { - encoder.Encode(response.RspObj) + _ = encoder.Encode(response.RspObj) } } bs := encoder.Buffer() @@ -118,10 +118,10 @@ func marshalResponse(encoder *hessian.Encoder, p DubboPackage) ([]byte, error) { func marshalRequest(encoder *hessian.Encoder, p DubboPackage) ([]byte, error) { service := p.Service request := EnsureRequestPayload(p.Body) - encoder.Encode(DEFAULT_DUBBO_PROTOCOL_VERSION) - encoder.Encode(service.Path) - encoder.Encode(service.Version) - encoder.Encode(service.Method) + _ = encoder.Encode(DEFAULT_DUBBO_PROTOCOL_VERSION) + _ = encoder.Encode(service.Path) + _ = encoder.Encode(service.Version) + _ = encoder.Encode(service.Method) args, ok := request.Params.([]interface{}) @@ -133,9 +133,9 @@ func marshalRequest(encoder *hessian.Encoder, p DubboPackage) ([]byte, error) { if err != nil { return nil, perrors.Wrapf(err, " PackRequest(args:%+v)", args) } - encoder.Encode(types) + _ = encoder.Encode(types) for _, v := range args { - encoder.Encode(v) + _ = encoder.Encode(v) } request.Attachments[PATH_KEY] = service.Path @@ -150,9 +150,8 @@ func marshalRequest(encoder *hessian.Encoder, p DubboPackage) ([]byte, error) { request.Attachments[TIMEOUT_KEY] = strconv.Itoa(int(service.Timeout / time.Millisecond)) } - encoder.Encode(request.Attachments) + _ = encoder.Encode(request.Attachments) return encoder.Buffer(), nil - } var versionInt = make(map[string]int) @@ -418,7 +417,7 @@ func getArgType(v interface{}) string { return "V" } - switch v.(type) { + switch v := v.(type) { // Serialized tags for base types case nil: return "V" diff --git a/protocol/dubbo/opentracing.go b/protocol/dubbo/opentracing.go index 2dcd6a4d0d9f491ba6d51ea7a3ba96812a6f9e08..f45e6fdc71af6279c2fadadd0576cde629a535e1 100644 --- a/protocol/dubbo/opentracing.go +++ b/protocol/dubbo/opentracing.go @@ -35,14 +35,6 @@ func injectTraceCtx(currentSpan opentracing.Span, inv *invocation_impl.RPCInvoca return err } -func extractTraceCtx(inv *invocation_impl.RPCInvocation) (opentracing.SpanContext, error) { - traceAttachments := filterContext(inv.Attachments()) - // actually, if user do not use any opentracing framework, the err will not be nil. - spanCtx, err := opentracing.GlobalTracer().Extract(opentracing.TextMap, - opentracing.TextMapCarrier(traceAttachments)) - return spanCtx, err -} - func filterContext(attachments map[string]interface{}) map[string]string { var traceAttchment = make(map[string]string) for k, v := range attachments { diff --git a/protocol/grpc/grpc_invoker.go b/protocol/grpc/grpc_invoker.go index 02e7716115e6bb22f3de5a8c4d8a2131995e81c6..9647ecb9c9498c78d9df49a2223a905fda8c5c6e 100644 --- a/protocol/grpc/grpc_invoker.go +++ b/protocol/grpc/grpc_invoker.go @@ -63,7 +63,7 @@ func (gi *GrpcInvoker) Invoke(ctx context.Context, invocation protocol.Invocatio } var in []reflect.Value - in = append(in, reflect.ValueOf(context.Background())) + in = append(in, reflect.ValueOf(ctx)) in = append(in, invocation.ParameterValues()...) methodName := invocation.MethodName() diff --git a/protocol/grpc/protoc-gen-dubbo/main.go b/protocol/grpc/protoc-gen-dubbo/main.go index fbcfa6f9d492afa8bc7848c733358b3cf7223e99..fe3e38dddd8bfc2a30ed89e6088516cad120ef79 100644 --- a/protocol/grpc/protoc-gen-dubbo/main.go +++ b/protocol/grpc/protoc-gen-dubbo/main.go @@ -43,7 +43,7 @@ func main() { g.Error(err, "reading input") } - if err := proto.Unmarshal(data, g.Request); err != nil { + if err = proto.Unmarshal(data, g.Request); err != nil { g.Error(err, "parsing input proto") } diff --git a/protocol/grpc/protoc-gen-dubbo/plugin/dubbo/dubbo.go b/protocol/grpc/protoc-gen-dubbo/plugin/dubbo/dubbo.go index a9f50e82879e1d6448300ec7b2a92e2a68070dc8..ba84f36b74016f1495fa7d616315deda7c54bbcc 100644 --- a/protocol/grpc/protoc-gen-dubbo/plugin/dubbo/dubbo.go +++ b/protocol/grpc/protoc-gen-dubbo/plugin/dubbo/dubbo.go @@ -28,19 +28,11 @@ import ( "github.com/golang/protobuf/protoc-gen-go/generator" ) -// generatedCodeVersion indicates a version of the generated code. -// It is incremented whenever an incompatibility between the generated code and -// the grpc package is introduced; the generated code references -// a constant, grpc.SupportPackageIsVersionN (where N is generatedCodeVersion). -const generatedCodeVersion = 4 - // Paths for packages used by code generated in this file, // relative to the import_prefix of the generator.Generator. const ( contextPkgPath = "context" grpcPkgPath = "google.golang.org/grpc" - codePkgPath = "google.golang.org/grpc/codes" - statusPkgPath = "google.golang.org/grpc/status" ) func init() { @@ -262,8 +254,8 @@ func (g *dubboGrpc) generateClientSignature(servName string, method *pb.MethodDe return fmt.Sprintf("%s func(ctx %s.Context%s, %s) error", methName, contextPkg, reqArg, respName) } -func (g *dubboGrpc) generateClientMethod(servName, fullServName, serviceDescVar string, method *pb.MethodDescriptorProto, descExpr string) { -} +//func (g *dubboGrpc) generateClientMethod(servName, fullServName, serviceDescVar string, method *pb.MethodDescriptorProto, descExpr string) { +//} func (g *dubboGrpc) generateServerMethod(servName, fullServName string, method *pb.MethodDescriptorProto) string { methName := generator.CamelCase(method.GetName()) @@ -281,7 +273,7 @@ func (g *dubboGrpc) generateServerMethod(servName, fullServName string, method * g.P(`invo := invocation.NewRPCInvocation("`, methName, `", args, nil)`) g.P("if interceptor == nil {") - g.P("result := base.GetProxyImpl().Invoke(context.Background(), invo)") + g.P("result := base.GetProxyImpl().Invoke(ctx, invo)") g.P("return result.Result(), result.Error()") g.P("}") @@ -291,7 +283,7 @@ func (g *dubboGrpc) generateServerMethod(servName, fullServName string, method * g.P("}") g.P("handler := func(ctx ", contextPkg, ".Context, req interface{}) (interface{}, error) {") - g.P("result := base.GetProxyImpl().Invoke(context.Background(), invo)") + g.P("result := base.GetProxyImpl().Invoke(ctx, invo)") g.P("return result.Result(), result.Error()") g.P("}") diff --git a/protocol/invocation.go b/protocol/invocation.go index 452f619e2dd9a5835141d91d7adfed37bb9f6859..2ecc817cc91e08fb6be10a0348477943d05bb1e3 100644 --- a/protocol/invocation.go +++ b/protocol/invocation.go @@ -25,6 +25,8 @@ import ( type Invocation interface { // MethodName gets invocation method name. MethodName() string + // ParameterTypeNames gets invocation parameter type names. + ParameterTypeNames() []string // ParameterTypes gets invocation parameter types. ParameterTypes() []reflect.Type // ParameterValues gets invocation parameter values. diff --git a/protocol/invocation/rpcinvocation.go b/protocol/invocation/rpcinvocation.go index 4e806324bf7b236d80a932a92898ba117fb1638d..ec68ca38991df1c1eae88f3ea64cca34c6981804 100644 --- a/protocol/invocation/rpcinvocation.go +++ b/protocol/invocation/rpcinvocation.go @@ -35,8 +35,11 @@ import ( // todo: is it necessary to separate fields of consumer(provider) from RPCInvocation // nolint type RPCInvocation struct { - methodName string - parameterTypes []reflect.Type + methodName string + // Parameter Type Names. It is used to specify the parameterType + parameterTypeNames []string + parameterTypes []reflect.Type + parameterValues []reflect.Value arguments []interface{} reply interface{} @@ -80,6 +83,11 @@ func (r *RPCInvocation) ParameterTypes() []reflect.Type { return r.parameterTypes } +// ParameterTypeNames gets RPC invocation parameter types of string expression. +func (r *RPCInvocation) ParameterTypeNames() []string { + return r.parameterTypeNames +} + // ParameterValues gets RPC invocation parameter values. func (r *RPCInvocation) ParameterValues() []reflect.Value { return r.parameterValues @@ -213,6 +221,18 @@ func WithParameterTypes(parameterTypes []reflect.Type) option { } } +// WithParameterTypeNames creates option with @parameterTypeNames. +func WithParameterTypeNames(parameterTypeNames []string) option { + return func(invo *RPCInvocation) { + if len(parameterTypeNames) == 0 { + return + } + parameterTypeNamesTmp := make([]string, len(parameterTypeNames)) + copy(parameterTypeNamesTmp, parameterTypeNames) + invo.parameterTypeNames = parameterTypeNamesTmp + } +} + // WithParameterValues creates option with @parameterValues func WithParameterValues(parameterValues []reflect.Value) option { return func(invo *RPCInvocation) { diff --git a/protocol/jsonrpc/http.go b/protocol/jsonrpc/http.go index 869617ea4eb512df6287d21e9d811145c1944e57..11051df8ac05010e9e07fe14d44768dda9342201 100644 --- a/protocol/jsonrpc/http.go +++ b/protocol/jsonrpc/http.go @@ -49,14 +49,14 @@ import ( // Request is HTTP protocol request type Request struct { - ID int64 - group string - protocol string - version string - service string - method string - args interface{} - contentType string + ID int64 + group string + protocol string + version string + service string + method string + args interface{} + //contentType string } // //////////////////////////////////////////// @@ -181,15 +181,17 @@ func (c *HTTPClient) Do(addr, path string, httpHeader http.Header, body []byte) return nil, perrors.WithStack(err) } defer tcpConn.Close() - setNetConnTimeout := func(conn net.Conn, timeout time.Duration) { + setNetConnTimeout := func(conn net.Conn, timeout time.Duration) error { t := time.Time{} if timeout > time.Duration(0) { t = time.Now().Add(timeout) } - conn.SetDeadline(t) + return conn.SetDeadline(t) + } + if err = setNetConnTimeout(tcpConn, c.options.HTTPTimeout); err != nil { + return nil, err } - setNetConnTimeout(tcpConn, c.options.HTTPTimeout) if _, err = reqBuf.WriteTo(tcpConn); err != nil { return nil, perrors.WithStack(err) diff --git a/protocol/jsonrpc/http_test.go b/protocol/jsonrpc/http_test.go index c4801c8db883353c82762162a7b658f964fc6ffa..5ef40649b1fcb209f29d9bbe871e47b1fcda8a59 100644 --- a/protocol/jsonrpc/http_test.go +++ b/protocol/jsonrpc/http_test.go @@ -44,7 +44,7 @@ type ( } UserProvider struct { - user map[string]User + //user map[string]User } ) diff --git a/protocol/jsonrpc/json.go b/protocol/jsonrpc/json.go index 506c4c953b1b1113b43669171efdeeaeb6fca10d..81ca512271baa19a103b42c059ba63fd14513377 100644 --- a/protocol/jsonrpc/json.go +++ b/protocol/jsonrpc/json.go @@ -48,13 +48,11 @@ type CodecData struct { const ( // Errors defined in the JSON-RPC spec. See // http://www.jsonrpc.org/specification#error_object. - CodeParseError = -32700 - CodeInvalidRequest = -32600 - CodeMethodNotFound = -32601 - CodeInvalidParams = -32602 - CodeInternalError = -32603 - codeServerErrorStart = -32099 - codeServerErrorEnd = -32000 + CodeParseError = -32700 + CodeInvalidRequest = -32600 + CodeMethodNotFound = -32601 + CodeInvalidParams = -32602 + CodeInternalError = -32603 ) // Error response Error diff --git a/protocol/jsonrpc/jsonrpc_invoker.go b/protocol/jsonrpc/jsonrpc_invoker.go index f10aaad824cea9c953cf994bd7349b57f6bfffa8..357443f5d4efbe5159fb6c0e09d3dab51266dc73 100644 --- a/protocol/jsonrpc/jsonrpc_invoker.go +++ b/protocol/jsonrpc/jsonrpc_invoker.go @@ -45,10 +45,7 @@ func NewJsonrpcInvoker(url *common.URL, client *HTTPClient) *JsonrpcInvoker { // Invoke the JSON RPC invocation and return result. func (ji *JsonrpcInvoker) Invoke(ctx context.Context, invocation protocol.Invocation) protocol.Result { - - var ( - result protocol.RPCResult - ) + var result protocol.RPCResult inv := invocation.(*invocation_impl.RPCInvocation) url := ji.GetUrl() diff --git a/protocol/jsonrpc/server.go b/protocol/jsonrpc/server.go index 755aa7da79384842d5a3f3c4364fc991d84b47df..76901bff6e62748e103d8691f75aedcf68dd202a 100644 --- a/protocol/jsonrpc/server.go +++ b/protocol/jsonrpc/server.go @@ -92,7 +92,9 @@ func (s *Server) handlePkg(conn net.Conn) { t = time.Now().Add(timeout) } - conn.SetDeadline(t) + if err := conn.SetDeadline(t); err != nil { + logger.Error("connection.SetDeadline(t:%v) = error:%v", t, err) + } } sendErrorResp := func(header http.Header, body []byte) error { @@ -239,7 +241,9 @@ func (s *Server) Start(url *common.URL) { s.wg.Add(1) go func() { - accept(listener, func(conn net.Conn) { s.handlePkg(conn) }) + if err := accept(listener, func(conn net.Conn) { s.handlePkg(conn) }); err != nil { + logger.Error("accept() = error:%v", err) + } s.wg.Done() }() diff --git a/protocol/protocolwrapper/mock_protocol_filter.go b/protocol/protocolwrapper/mock_protocol_filter.go index 18a4e1562107939e9c72090778422e0d8bb56a60..d1baba813416ff688c5f9ccccf05e276c55c2bba 100644 --- a/protocol/protocolwrapper/mock_protocol_filter.go +++ b/protocol/protocolwrapper/mock_protocol_filter.go @@ -45,5 +45,4 @@ func (pfw *mockProtocolFilter) Refer(url *common.URL) protocol.Invoker { // Destroy will do nothing func (pfw *mockProtocolFilter) Destroy() { - return } diff --git a/protocol/protocolwrapper/protocol_filter_wrapper.go b/protocol/protocolwrapper/protocol_filter_wrapper.go index 79d2cf7f55ee81db39ea28448fc66a8a7494d8d1..448bd6f5a90ae0fe3732845d9ce9e2fa238e8e74 100644 --- a/protocol/protocolwrapper/protocol_filter_wrapper.go +++ b/protocol/protocolwrapper/protocol_filter_wrapper.go @@ -59,7 +59,11 @@ func (pfw *ProtocolFilterWrapper) Refer(url *common.URL) protocol.Invoker { if pfw.protocol == nil { pfw.protocol = extension.GetProtocol(url.Protocol) } - return buildInvokerChain(pfw.protocol.Refer(url), constant.REFERENCE_FILTER_KEY) + invoker := pfw.protocol.Refer(url) + if invoker == nil { + return nil + } + return buildInvokerChain(invoker, constant.REFERENCE_FILTER_KEY) } // Destroy will destroy all invoker and exporter. @@ -77,7 +81,7 @@ func buildInvokerChain(invoker protocol.Invoker, key string) protocol.Invoker { // The order of filters is from left to right, so loading from right to left next := invoker for i := len(filterNames) - 1; i >= 0; i-- { - flt := extension.GetFilter(filterNames[i]) + flt := extension.GetFilter(strings.TrimSpace(filterNames[i])) fi := &FilterInvoker{next: next, invoker: invoker, filter: flt} next = fi } diff --git a/protocol/protocolwrapper/protocol_filter_wrapper_test.go b/protocol/protocolwrapper/protocol_filter_wrapper_test.go index 8f063f85521bbdcd3fa3891e7d09754fc9b58ac7..b37d066f03c8084d2d529217567c1ede940a5491 100644 --- a/protocol/protocolwrapper/protocol_filter_wrapper_test.go +++ b/protocol/protocolwrapper/protocol_filter_wrapper_test.go @@ -42,7 +42,7 @@ func TestProtocolFilterWrapperExport(t *testing.T) { u := common.NewURLWithOptions( common.WithParams(url.Values{}), - common.WithParamsValue(constant.SERVICE_FILTER_KEY, "echo")) + common.WithParamsValue(constant.SERVICE_FILTER_KEY, "echo ")) exporter := filtProto.Export(protocol.NewBaseInvoker(u)) _, ok := exporter.GetInvoker().(*FilterInvoker) assert.True(t, ok) @@ -54,7 +54,7 @@ func TestProtocolFilterWrapperRefer(t *testing.T) { u := common.NewURLWithOptions( common.WithParams(url.Values{}), - common.WithParamsValue(constant.REFERENCE_FILTER_KEY, "echo")) + common.WithParamsValue(constant.REFERENCE_FILTER_KEY, " echo")) invoker := filtProto.Refer(u) _, ok := invoker.(*FilterInvoker) assert.True(t, ok) diff --git a/protocol/rest/server/rest_server.go b/protocol/rest/server/rest_server.go index 3a1cb19396b1c129aa836e228991a22426065f4a..b0bf0e07bdd2c1351b1d9c1f55187515e3cc852c 100644 --- a/protocol/rest/server/rest_server.go +++ b/protocol/rest/server/rest_server.go @@ -257,6 +257,7 @@ func assembleArgsFromQueryParams(methodConfig *rest_config.RestMethodConfig, arg kind := t.Kind() if kind == reflect.Ptr { t = t.Elem() + kind = t.Kind() } if kind == reflect.Slice { param = req.QueryParameters(v) @@ -297,6 +298,7 @@ func assembleArgsFromPathParams(methodConfig *rest_config.RestMethodConfig, args kind := t.Kind() if kind == reflect.Ptr { t = t.Elem() + kind = t.Kind() } if kind == reflect.Int { param, err = strconv.Atoi(req.PathParameter(v)) diff --git a/registry/base_configuration_listener.go b/registry/base_configuration_listener.go index 3b36510306680486ba9d269472450df8867b61b1..31e859eec279f08f4fd286bf021414bdb297a333 100644 --- a/registry/base_configuration_listener.go +++ b/registry/base_configuration_listener.go @@ -20,6 +20,7 @@ package registry import ( perrors "github.com/pkg/errors" ) + import ( "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/config" @@ -42,7 +43,9 @@ func (bcl *BaseConfigurationListener) Configurators() []config_center.Configurat } // InitWith will init BaseConfigurationListener by @key+@Listener+@f -func (bcl *BaseConfigurationListener) InitWith(key string, listener config_center.ConfigurationListener, f func(url *common.URL) config_center.Configurator) { +func (bcl *BaseConfigurationListener) InitWith(key string, listener config_center.ConfigurationListener, + f func(url *common.URL) config_center.Configurator) { + bcl.dynamicConfiguration = config.GetEnvInstance().GetDynamicConfiguration() if bcl.dynamicConfiguration == nil { //set configurators to empty @@ -51,12 +54,15 @@ func (bcl *BaseConfigurationListener) InitWith(key string, listener config_cente } bcl.defaultConfiguratorFunc = f bcl.dynamicConfiguration.AddListener(key, listener) - if rawConfig, err := bcl.dynamicConfiguration.GetInternalProperty(key, config_center.WithGroup(constant.DUBBO)); err != nil { + if rawConfig, err := bcl.dynamicConfiguration.GetInternalProperty(key, + config_center.WithGroup(constant.DUBBO)); err != nil { //set configurators to empty bcl.configurators = []config_center.Configurator{} return } else if len(rawConfig) > 0 { - bcl.genConfiguratorFromRawRule(rawConfig) + if err := bcl.genConfiguratorFromRawRule(rawConfig); err != nil { + logger.Error("bcl.genConfiguratorFromRawRule(rawConfig:%v) = error:%v", rawConfig, err) + } } } diff --git a/registry/base_registry.go b/registry/base_registry.go index a6693be3a862eb208afc216840910c323b8e826f..e97cc1a4ed6c85fa464d3398b4706e99f7a7f535 100644 --- a/registry/base_registry.go +++ b/registry/base_registry.go @@ -18,7 +18,6 @@ package registry import ( - "context" "fmt" "net/url" "os" @@ -93,7 +92,7 @@ type FacadeBasedRegistry interface { // BaseRegistry is a common logic abstract for registry. It implement Registry interface. type BaseRegistry struct { - context context.Context + //context context.Context facadeBasedRegistry FacadeBasedRegistry *common.URL birth int64 // time of file birth, seconds since Epoch; 0 if unknown @@ -273,6 +272,10 @@ func (r *BaseRegistry) processURL(c *common.URL, f func(string, string) error, c default: return perrors.Errorf("@c{%v} type is not referencer or provider", c) } + if err != nil { + return perrors.WithMessagef(err, "@c{%v} registry fail", c) + } + encodedURL = url.QueryEscape(rawURL) dubboPath = strings.ReplaceAll(dubboPath, "$", "%24") err = f(dubboPath, encodedURL) diff --git a/registry/consul/registry.go b/registry/consul/registry.go index 0b7ba9758952b072d579ae9424e2c385e59a4378..4d3718e58cd0f98b931ed525fe61f33713b6e71f 100644 --- a/registry/consul/registry.go +++ b/registry/consul/registry.go @@ -23,6 +23,7 @@ import ( ) import ( + getty "github.com/apache/dubbo-getty" consul "github.com/hashicorp/consul/api" perrors "github.com/pkg/errors" ) @@ -56,6 +57,10 @@ type consulRegistry struct { // Done field represents whether // consul registry is closed. done chan struct{} + + // registeredURLs field represents all URLs that have been registered + // will be unregistered when destroyed + registeredURLs []*common.URL } func newConsulRegistry(url *common.URL) (registry.Registry, error) { @@ -91,6 +96,7 @@ func (r *consulRegistry) Register(url *common.URL) error { // register actually register the @url func (r *consulRegistry) register(url *common.URL) error { + r.registeredURLs = append(r.registeredURLs, url.Clone()) service, err := buildService(url) if err != nil { return err @@ -188,25 +194,26 @@ func (r *consulRegistry) IsAvailable() bool { // Destroy consul registry center func (r *consulRegistry) Destroy() { - if r.URL != nil { - done := make(chan struct{}, 1) - go func() { - defer func() { - if e := recover(); e != nil { - logger.Errorf("consulRegistry destory with panic: %v", e) - } - done <- struct{}{} - }() - if err := r.UnRegister(r.URL); err != nil { - logger.Errorf("consul registry unregister with err: %s", err.Error()) + done := make(chan struct{}, 1) + go func() { + defer func() { + if e := recover(); e != nil { + logger.Errorf("consulRegistry destroy with panic: %v", e) } + done <- struct{}{} }() - select { - case <-done: - logger.Infof("consulRegistry unregister done") - case <-time.After(registryDestroyDefaultTimeout): - logger.Errorf("consul unregister timeout") + for _, url := range r.registeredURLs { + if err := r.UnRegister(url); err != nil { + logger.Errorf("consul registry unregister with err: %s", err.Error()) + } } + }() + select { + case <-done: + logger.Infof("consulRegistry unregister done") + case <-getty.GetTimeWheel().After(registryDestroyDefaultTimeout): + logger.Errorf("consul unregister timeout") } + close(r.done) } diff --git a/registry/consul/service_discovery.go b/registry/consul/service_discovery.go index d8ab93f31ee6fdcf79aa869a35548e8192841fe4..fba142e04e4979b9c4fe123cc121111838ae2d4e 100644 --- a/registry/consul/service_discovery.go +++ b/registry/consul/service_discovery.go @@ -27,7 +27,7 @@ import ( import ( "github.com/dubbogo/gost/container/set" - "github.com/dubbogo/gost/page" + "github.com/dubbogo/gost/hash/page" consul "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/api/watch" perrors "github.com/pkg/errors" @@ -252,7 +252,7 @@ func (csd *consulServiceDiscovery) GetServices() *gxset.HashSet { return res } - for service, _ := range services { + for service := range services { res.Add(service) } return res @@ -339,7 +339,7 @@ func (csd *consulServiceDiscovery) GetInstancesByPage(serviceName string, offset for i := offset; i < len(all) && i < offset+pageSize; i++ { res = append(res, all[i]) } - return gxpage.New(offset, pageSize, res, len(all)) + return gxpage.NewPage(offset, pageSize, res, len(all)) } func (csd *consulServiceDiscovery) GetHealthyInstancesByPage(serviceName string, offset int, pageSize int, healthy bool) gxpage.Pager { @@ -358,7 +358,7 @@ func (csd *consulServiceDiscovery) GetHealthyInstancesByPage(serviceName string, } i++ } - return gxpage.New(offset, pageSize, res, len(all)) + return gxpage.NewPage(offset, pageSize, res, len(all)) } func (csd *consulServiceDiscovery) GetRequestInstances(serviceNames []string, offset int, requestedSize int) map[string]gxpage.Pager { @@ -444,7 +444,7 @@ func (csd *consulServiceDiscovery) buildRegisterInstance(instance registry.Servi metadata = encodeConsulMetadata(metadata) metadata[enable] = strconv.FormatBool(instance.IsEnable()) // check - check := csd.buildCheck(instance) + check := csd.buildCheck() return &consul.AgentServiceRegistration{ ID: buildID(instance), @@ -456,12 +456,7 @@ func (csd *consulServiceDiscovery) buildRegisterInstance(instance registry.Servi }, nil } -func (csd *consulServiceDiscovery) buildCheck(instance registry.ServiceInstance) consul.AgentServiceCheck { - - deregister, ok := instance.GetMetadata()[constant.DEREGISTER_AFTER] - if !ok || len(deregister) == 0 { - deregister = constant.DEFAULT_DEREGISTER_TIME - } +func (csd *consulServiceDiscovery) buildCheck() consul.AgentServiceCheck { return consul.AgentServiceCheck{ TTL: strconv.FormatInt(csd.checkPassInterval/1000, 10) + "s", DeregisterCriticalServiceAfter: csd.deregisterCriticalServiceAfter, diff --git a/registry/consul/service_discovery_test.go b/registry/consul/service_discovery_test.go index 2169857ee8f79a92322234a0b17a4d7122a0d975..3f97d841d56111746f396ba753142324ac4555d2 100644 --- a/registry/consul/service_discovery_test.go +++ b/registry/consul/service_discovery_test.go @@ -84,7 +84,10 @@ func TestConsulServiceDiscovery_Destroy(t *testing.T) { func TestConsulServiceDiscovery_CRUD(t *testing.T) { // start consul agent consulAgent := consul.NewConsulAgent(t, registryPort) - defer consulAgent.Shutdown() + defer func() { + err := consulAgent.Shutdown() + assert.NoError(t, err) + }() prepareData() var eventDispatcher = MockEventDispatcher{Notify: make(chan struct{}, 1)} @@ -138,7 +141,8 @@ func TestConsulServiceDiscovery_CRUD(t *testing.T) { assert.Equal(t, 1, len(page.GetData())) instanceResult = page.GetData()[0].(*registry.DefaultServiceInstance) - v, _ := instanceResult.Metadata["aaa"] + v, ok := instanceResult.Metadata["aaa"] + assert.True(t, ok) assert.Equal(t, "bbb", v) // test dispatcher event diff --git a/registry/consul/utils.go b/registry/consul/utils.go index 468dafb338e8413c66d00da974c860708a2e2210..76f5d2dd3378f67d300d10b4c5ecc72934ef7715 100644 --- a/registry/consul/utils.go +++ b/registry/consul/utils.go @@ -107,7 +107,7 @@ func retrieveURL(service *consul.ServiceEntry) (*common.URL, error) { func in(url *common.URL, urls []*common.URL) bool { for _, url1 := range urls { - if url.URLEqual(url1) { + if common.IsEquals(url, url1) { return true } } diff --git a/registry/consul/utils_test.go b/registry/consul/utils_test.go index d78c534e931f9aa3e0220bb08aa29222220ce619..b7e2929cec13c839a8ebaa9cb8a3000ab2cafef3 100644 --- a/registry/consul/utils_test.go +++ b/registry/consul/utils_test.go @@ -19,6 +19,8 @@ package consul import ( "fmt" + "github.com/apache/dubbo-go/common/logger" + "github.com/stretchr/testify/assert" "net" "net/url" "strconv" @@ -113,15 +115,24 @@ func (server *testServer) serve() { if err != nil { continue } - conn.Write([]byte("Hello World")) - conn.Close() + _, err = conn.Write([]byte("Hello World")) + if err != nil { + logger.Warnf("conn.Write() = error: %v", err) + } + err = conn.Close() + if err != nil { + logger.Warnf("conn.Close() = error: %v", err) + } } } } func (server *testServer) close() { close(server.done) - server.listener.Close() + if err := server.listener.Close(); err != nil { + fmt.Printf("server.listener.Close() = error:%v\n", err) + } + server.wg.Wait() } @@ -148,7 +159,10 @@ func (suite *consulRegistryTestSuite) close() { // register -> subscribe -> unregister func test1(t *testing.T) { consulAgent := consul.NewConsulAgent(t, registryPort) - defer consulAgent.Shutdown() + defer func() { + err := consulAgent.Shutdown() + assert.NoError(t, err) + }() server := newServer(providerHost, providerPort) defer server.close() @@ -169,7 +183,10 @@ func test1(t *testing.T) { // subscribe -> register -> unregister func test2(t *testing.T) { consulAgent := consul.NewConsulAgent(t, registryPort) - defer consulAgent.Shutdown() + defer func() { + err := consulAgent.Shutdown() + assert.NoError(t, err) + }() server := newServer(providerHost, providerPort) defer server.close() diff --git a/registry/directory/directory.go b/registry/directory/directory.go index e6ae0f3bb9004f8b933d420cdd2e7561f8232b48..1b607351af0b527f9ace4fa77268e100aa8fa2dc 100644 --- a/registry/directory/directory.go +++ b/registry/directory/directory.go @@ -26,7 +26,6 @@ import ( import ( perrors "github.com/pkg/errors" - "go.uber.org/atomic" ) import ( @@ -64,8 +63,9 @@ type RegistryDirectory struct { configurators []config_center.Configurator consumerConfigurationListener *consumerConfigurationListener referenceConfigurationListener *referenceConfigurationListener - serviceKey string - forbidden atomic.Bool + //serviceKey string + //forbidden atomic.Bool + registerLock sync.Mutex // this lock if for register } // NewRegistryDirectory will create a new RegistryDirectory @@ -73,6 +73,7 @@ func NewRegistryDirectory(url *common.URL, registry registry.Registry) (cluster. if url.SubURL == nil { return nil, perrors.Errorf("url is invalid, suburl can not be nil") } + logger.Debugf("new RegistryDirectory for service :%s.", url.Key()) dir := &RegistryDirectory{ BaseDirectory: directory.NewBaseDirectory(url), cacheInvokers: []protocol.Invoker{}, @@ -97,69 +98,129 @@ func NewRegistryDirectory(url *common.URL, registry registry.Registry) (cluster. // subscribe from registry func (dir *RegistryDirectory) subscribe(url *common.URL) { + logger.Debugf("subscribe service :%s for RegistryDirectory.", url.Key()) dir.consumerConfigurationListener.addNotifyListener(dir) dir.referenceConfigurationListener = newReferenceConfigurationListener(dir, url) - dir.registry.Subscribe(url, dir) + if err := dir.registry.Subscribe(url, dir); err != nil { + logger.Error("registry.Subscribe(url:%v, dir:%v) = error:%v", url, dir, err) + } } // Notify monitor changes from registry,and update the cacheServices -func (dir *RegistryDirectory) Notify(events ...*registry.ServiceEvent) { - go dir.refreshInvokers(events...) +func (dir *RegistryDirectory) Notify(event *registry.ServiceEvent) { + if event == nil { + return + } + go dir.refreshInvokers(event) +} + +// NotifyAll notify the events that are complete Service Event List. +// After notify the address, the callback func will be invoked. +func (dir *RegistryDirectory) NotifyAll(events []*registry.ServiceEvent, callback func()) { + go dir.refreshAllInvokers(events, callback) +} + +// refreshInvokers refreshes service's events. +func (dir *RegistryDirectory) refreshInvokers(event *registry.ServiceEvent) { + if event != nil { + logger.Debugf("refresh invokers with %+v", event) + } else { + logger.Debug("refresh invokers with nil") + } + + var oldInvoker protocol.Invoker + if event != nil { + oldInvoker, _ = dir.cacheInvokerByEvent(event) + } + dir.setNewInvokers() + if oldInvoker != nil { + oldInvoker.Destroy() + } } -// refreshInvokers refreshes service's events. It supports two modes: incremental mode and batch mode. If a single -// service event is passed in, then it is incremental mode, and if an array of service events are passed in, it is -// batch mode, in this mode, we assume the registry center have the complete list of the service events, therefore -// in this case, we can safely assume any cached invoker not in the incoming list can be removed. It is necessary -// since in batch mode, the register center handles the different type of events by itself, then notify the directory -// a batch of 'Update' events, instead of omit the different type of event one by one. -func (dir *RegistryDirectory) refreshInvokers(events ...*registry.ServiceEvent) { - var oldInvokers []protocol.Invoker +// refreshAllInvokers the argument is the complete list of the service events, we can safely assume any cached invoker +// not in the incoming list can be removed. The Action of serviceEvent should be EventTypeUpdate. +func (dir *RegistryDirectory) refreshAllInvokers(events []*registry.ServiceEvent, callback func()) { + var ( + oldInvokers []protocol.Invoker + addEvents []*registry.ServiceEvent + ) + dir.overrideUrl(dir.GetDirectoryUrl()) + referenceUrl := dir.GetDirectoryUrl().SubURL - // in batch mode, it is safe to remove since we have the complete list of events. - if len(events) > 1 { + // loop the events to check the Action should be EventTypeUpdate. + for _, event := range events { + if event.Action != remoting.EventTypeUpdate { + panic("Your implements of register center is wrong, " + + "please check the Action of ServiceEvent should be EventTypeUpdate") + } + // Originally it will Merge URL many times, now we just execute once. + // MergeUrl is executed once and put the result into Event. After this, the key will get from Event.Key(). + newUrl := dir.convertUrl(event) + newUrl = common.MergeUrl(newUrl, referenceUrl) + dir.overrideUrl(newUrl) + event.Update(newUrl) + } + // After notify all addresses, do some callback. + defer callback() + func() { + // this lock is work at batch update of InvokeCache + dir.registerLock.Lock() + defer dir.registerLock.Unlock() + // get need clear invokers from original invoker list dir.cacheInvokersMap.Range(func(k, v interface{}) bool { if !dir.eventMatched(k.(string), events) { + // delete unused invoker from cache if invoker := dir.uncacheInvokerWithKey(k.(string)); invoker != nil { oldInvokers = append(oldInvokers, invoker) } } return true }) - } - - for _, event := range events { - logger.Debugf("registry update, result{%s}", event) - if oldInvoker, _ := dir.cacheInvokerByEvent(event); oldInvoker != nil { - oldInvokers = append(oldInvokers, oldInvoker) + // get need add invokers from events + for _, event := range events { + // Get the key from Event.Key() + if _, ok := dir.cacheInvokersMap.Load(event.Key()); !ok { + addEvents = append(addEvents, event) + } } - } - - if len(events) > 0 { - dir.setNewInvokers() - } - - // After dir.cacheInvokers is updated,destroy the oldInvoker - // Ensure that no request will enter the oldInvoker + // loop the updateEvents + for _, event := range addEvents { + logger.Debugf("registry update, result{%s}", event) + logger.Infof("selector add service url{%s}", event.Service) + // FIXME: routers are built in every address notification? + dir.configRouters() + if oldInvoker, _ := dir.doCacheInvoker(event.Service); oldInvoker != nil { + oldInvokers = append(oldInvokers, oldInvoker) + } + } + }() + dir.setNewInvokers() + // destroy unused invokers for _, invoker := range oldInvokers { - invoker.Destroy() + go invoker.Destroy() } } // eventMatched checks if a cached invoker appears in the incoming invoker list, if no, then it is safe to remove. func (dir *RegistryDirectory) eventMatched(key string, events []*registry.ServiceEvent) bool { for _, event := range events { - if dir.invokerCacheKey(event.Service) == key { + if dir.invokerCacheKey(event) == key { return true } } return false } -// invokerCacheKey generates the key in the cache for a given URL. -func (dir *RegistryDirectory) invokerCacheKey(url *common.URL) string { +// invokerCacheKey generates the key in the cache for a given ServiceEvent. +func (dir *RegistryDirectory) invokerCacheKey(event *registry.ServiceEvent) string { + // If the url is merged, then return Event.Key() directly. + if event.Updated() { + return event.Key() + } referenceUrl := dir.GetDirectoryUrl().SubURL - newUrl := common.MergeUrl(url, referenceUrl) + newUrl := common.MergeUrl(event.Service, referenceUrl) + event.Update(newUrl) return newUrl.Key() } @@ -234,11 +295,7 @@ func (dir *RegistryDirectory) toGroupInvokers() []protocol.Invoker { for _, invoker := range newInvokersList { group := invoker.GetUrl().GetParam(constant.GROUP_KEY, "") - if _, ok := groupInvokersMap[group]; ok { - groupInvokersMap[group] = append(groupInvokersMap[group], invoker) - } else { - groupInvokersMap[group] = []protocol.Invoker{invoker} - } + groupInvokersMap[group] = append(groupInvokersMap[group], invoker) } groupInvokersList := make([]protocol.Invoker, 0, len(groupInvokersMap)) if len(groupInvokersMap) == 1 { @@ -294,30 +351,38 @@ func (dir *RegistryDirectory) cacheInvoker(url *common.URL) protocol.Invoker { if url.Protocol == referenceUrl.Protocol || referenceUrl.Protocol == "" { newUrl := common.MergeUrl(url, referenceUrl) dir.overrideUrl(newUrl) - if cacheInvoker, ok := dir.cacheInvokersMap.Load(newUrl.Key()); !ok { - logger.Debugf("service will be added in cache invokers: invokers url is %s!", newUrl) - newInvoker := extension.GetProtocol(protocolwrapper.FILTER).Refer(newUrl) - if newInvoker != nil { - dir.cacheInvokersMap.Store(newUrl.Key(), newInvoker) - } - } else { - // if cached invoker has the same URL with the new URL, then no need to re-refer, and no need to destroy - // the old invoker. - if common.IsEquals(newUrl, cacheInvoker.(protocol.Invoker).GetUrl()) { - return nil - } - - logger.Debugf("service will be updated in cache invokers: new invoker url is %s, old invoker url is %s", newUrl, cacheInvoker.(protocol.Invoker).GetUrl()) - newInvoker := extension.GetProtocol(protocolwrapper.FILTER).Refer(newUrl) - if newInvoker != nil { - dir.cacheInvokersMap.Store(newUrl.Key(), newInvoker) - return cacheInvoker.(protocol.Invoker) - } + if v, ok := dir.doCacheInvoker(newUrl); ok { + return v } } return nil } +func (dir *RegistryDirectory) doCacheInvoker(newUrl *common.URL) (protocol.Invoker, bool) { + key := newUrl.Key() + if cacheInvoker, ok := dir.cacheInvokersMap.Load(key); !ok { + logger.Debugf("service will be added in cache invokers: invokers url is %s!", newUrl) + newInvoker := extension.GetProtocol(protocolwrapper.FILTER).Refer(newUrl) + if newInvoker != nil { + dir.cacheInvokersMap.Store(key, newInvoker) + } + } else { + // if cached invoker has the same URL with the new URL, then no need to re-refer, and no need to destroy + // the old invoker. + if common.GetCompareURLEqualFunc()(newUrl, cacheInvoker.(protocol.Invoker).GetUrl()) { + return nil, true + } + + logger.Debugf("service will be updated in cache invokers: new invoker url is %s, old invoker url is %s", newUrl, cacheInvoker.(protocol.Invoker).GetUrl()) + newInvoker := extension.GetProtocol(protocolwrapper.FILTER).Refer(newUrl) + if newInvoker != nil { + dir.cacheInvokersMap.Store(key, newInvoker) + return cacheInvoker.(protocol.Invoker), true + } + } + return nil, false +} + // List selected protocol invokers from the directory func (dir *RegistryDirectory) List(invocation protocol.Invocation) []protocol.Invoker { invokers := dir.cacheInvokers @@ -406,7 +471,7 @@ func newReferenceConfigurationListener(dir *RegistryDirectory, url *common.URL) func (l *referenceConfigurationListener) Process(event *config_center.ConfigChangeEvent) { l.BaseConfigurationListener.Process(event) // FIXME: this doesn't trigger dir.overrideUrl() - l.directory.refreshInvokers() + l.directory.refreshInvokers(nil) } type consumerConfigurationListener struct { @@ -433,5 +498,5 @@ func (l *consumerConfigurationListener) addNotifyListener(listener registry.Noti func (l *consumerConfigurationListener) Process(event *config_center.ConfigChangeEvent) { l.BaseConfigurationListener.Process(event) // FIXME: this doesn't trigger dir.overrideUrl() - l.directory.refreshInvokers() + l.directory.refreshInvokers(nil) } diff --git a/registry/directory/directory_test.go b/registry/directory/directory_test.go index 9008e6ecb79993626bac19a8fcf6870532386b01..b5d81eb0da0b7ae635b8a54e3002a9380a69a2fd 100644 --- a/registry/directory/directory_test.go +++ b/registry/directory/directory_test.go @@ -192,6 +192,34 @@ func Test_toGroupInvokers(t *testing.T) { assert.Len(t, groupInvokers, 2) } +func Test_RefreshUrl(t *testing.T) { + registryDirectory, mockRegistry := normalRegistryDir() + providerUrl, _ := common.NewURL("dubbo://0.0.0.0:20011/org.apache.dubbo-go.mockService", + common.WithParamsValue(constant.CLUSTER_KEY, "mock1"), + common.WithParamsValue(constant.GROUP_KEY, "group"), + common.WithParamsValue(constant.VERSION_KEY, "1.0.0")) + providerUrl2, _ := common.NewURL("dubbo://0.0.0.0:20012/org.apache.dubbo-go.mockService", + common.WithParamsValue(constant.CLUSTER_KEY, "mock1"), + common.WithParamsValue(constant.GROUP_KEY, "group"), + common.WithParamsValue(constant.VERSION_KEY, "1.0.0")) + time.Sleep(1e9) + assert.Len(t, registryDirectory.cacheInvokers, 3) + mockRegistry.MockEvent(®istry.ServiceEvent{Action: remoting.EventTypeAdd, Service: providerUrl}) + time.Sleep(1e9) + assert.Len(t, registryDirectory.cacheInvokers, 4) + mockRegistry.MockEvents([]*registry.ServiceEvent{®istry.ServiceEvent{Action: remoting.EventTypeUpdate, Service: providerUrl}}) + time.Sleep(1e9) + assert.Len(t, registryDirectory.cacheInvokers, 1) + mockRegistry.MockEvents([]*registry.ServiceEvent{®istry.ServiceEvent{Action: remoting.EventTypeUpdate, Service: providerUrl}, + ®istry.ServiceEvent{Action: remoting.EventTypeUpdate, Service: providerUrl2}}) + time.Sleep(1e9) + assert.Len(t, registryDirectory.cacheInvokers, 2) + // clear all address + mockRegistry.MockEvents([]*registry.ServiceEvent{}) + time.Sleep(1e9) + assert.Len(t, registryDirectory.cacheInvokers, 0) +} + func normalRegistryDir(noMockEvent ...bool) (*RegistryDirectory, *registry.MockRegistry) { extension.SetProtocol(protocolwrapper.FILTER, protocolwrapper.NewMockProtocolFilter) diff --git a/registry/etcdv3/listener.go b/registry/etcdv3/listener.go index 4bc387cafaa3c64539efb29a181a2198fbe8a30f..f900495f97d3acfd9a2ae232264910b791961bc8 100644 --- a/registry/etcdv3/listener.go +++ b/registry/etcdv3/listener.go @@ -19,6 +19,7 @@ package etcdv3 import ( "strings" + "sync" ) import ( @@ -79,8 +80,9 @@ func (l *dataListener) DataChange(eventType remoting.Event) bool { } type configurationListener struct { - registry *etcdV3Registry - events chan *config_center.ConfigChangeEvent + registry *etcdV3Registry + events chan *config_center.ConfigChangeEvent + closeOnce sync.Once } // NewConfigurationListener for listening the event of etcdv3. @@ -120,5 +122,7 @@ func (l *configurationListener) Next() (*registry.ServiceEvent, error) { // Close etcd registry center func (l *configurationListener) Close() { - l.registry.WaitGroup().Done() + l.closeOnce.Do(func() { + l.registry.WaitGroup().Done() + }) } diff --git a/registry/etcdv3/registry.go b/registry/etcdv3/registry.go index f3cc379bd8e94b15b678f0ac1d5ed5b6c917da6a..7ccf32661c75ed4cd27fddd1fc020ded56066f37 100644 --- a/registry/etcdv3/registry.go +++ b/registry/etcdv3/registry.go @@ -51,7 +51,7 @@ type etcdV3Registry struct { registry.BaseRegistry cltLock sync.Mutex client *etcdv3.Client - listenerLock sync.Mutex + listenerLock sync.RWMutex listener *etcdv3.EventListener dataListener *dataListener configListener *configurationListener @@ -150,14 +150,9 @@ func (r *etcdV3Registry) CreatePath(k string) error { // DoSubscribe actually subscribe the provider URL func (r *etcdV3Registry) DoSubscribe(svc *common.URL) (registry.Listener, error) { - - var ( - configListener *configurationListener - ) - - r.listenerLock.Lock() - configListener = r.configListener - r.listenerLock.Unlock() + r.listenerLock.RLock() + configListener := r.configListener + r.listenerLock.RUnlock() if r.listener == nil { r.cltLock.Lock() client := r.client @@ -165,12 +160,8 @@ func (r *etcdV3Registry) DoSubscribe(svc *common.URL) (registry.Listener, error) if client == nil { return nil, perrors.New("etcd client broken") } - - // new client & listener - listener := etcdv3.NewEventListener(r.client) - r.listenerLock.Lock() - r.listener = listener + r.listener = etcdv3.NewEventListener(r.client) // new client & listener r.listenerLock.Unlock() } diff --git a/registry/etcdv3/service_discovery.go b/registry/etcdv3/service_discovery.go index e8d4aea9a42634896c3c30e5c6b527a935179873..ca6016e49b4e174e5843b3c08beea7b559bbfb9b 100644 --- a/registry/etcdv3/service_discovery.go +++ b/registry/etcdv3/service_discovery.go @@ -26,7 +26,7 @@ import ( import ( gxset "github.com/dubbogo/gost/container/set" - gxpage "github.com/dubbogo/gost/page" + gxpage "github.com/dubbogo/gost/hash/page" "github.com/hashicorp/vault/sdk/helper/jsonutil" perrors "github.com/pkg/errors" ) @@ -108,8 +108,11 @@ func (e *etcdV3ServiceDiscovery) Update(instance registry.ServiceInstance) error if nil != e.client { ins, err := jsonutil.EncodeJSON(instance) - if nil == err { - e.client.RegisterTemp(path, string(ins)) + if err == nil { + if err = e.client.RegisterTemp(path, string(ins)); err != nil { + logger.Warnf("etcdV3ServiceDiscovery.client.RegisterTemp(path:%v, instance:%v) = error:%v", + path, string(ins), err) + } e.services.Add(instance.GetServiceName()) } } @@ -162,7 +165,7 @@ func (e *etcdV3ServiceDiscovery) GetInstances(serviceName string) []registry.Ser logger.Infof("could not getChildrenKVList the err is:%v", err) } - return make([]registry.ServiceInstance, 0, 0) + return make([]registry.ServiceInstance, 0) } // GetInstancesByPage will return a page containing instances of ServiceInstance with the serviceName @@ -177,7 +180,7 @@ func (e *etcdV3ServiceDiscovery) GetInstancesByPage(serviceName string, offset i res = append(res, all[i]) } - return gxpage.New(offset, pageSize, res, len(all)) + return gxpage.NewPage(offset, pageSize, res, len(all)) } // GetHealthyInstancesByPage will return a page containing instances of ServiceInstance. @@ -199,7 +202,7 @@ func (e *etcdV3ServiceDiscovery) GetHealthyInstancesByPage(serviceName string, o } i++ } - return gxpage.New(offset, pageSize, res, len(all)) + return gxpage.NewPage(offset, pageSize, res, len(all)) } // Batch get all instances by the specified service names @@ -319,5 +322,5 @@ func newEtcdV3ServiceDiscovery(name string) (registry.ServiceDiscovery, error) { descriptor := fmt.Sprintf("etcd-service-discovery[%s]", remoteConfig.Address) - return &etcdV3ServiceDiscovery{descriptor, client, nil, gxset.NewSet(), make(map[string]*etcdv3.EventListener, 0)}, nil + return &etcdV3ServiceDiscovery{descriptor, client, nil, gxset.NewSet(), make(map[string]*etcdv3.EventListener)}, nil } diff --git a/registry/event.go b/registry/event.go index c93415841b1d144a462e7cf71713882e0bcdd8c6..2ebc375597aef67b7605073b852ce53f68cb58e4 100644 --- a/registry/event.go +++ b/registry/event.go @@ -41,11 +41,36 @@ func init() { type ServiceEvent struct { Action remoting.EventType Service *common.URL + // store the key for Service.Key() + key string + // If the url is updated, such as Merged. + updated bool } // String return the description of event -func (e ServiceEvent) String() string { - return fmt.Sprintf("ServiceEvent{Action{%s}, Path{%s}}", e.Action, e.Service) +func (e *ServiceEvent) String() string { + return fmt.Sprintf("ServiceEvent{Action{%s}, Path{%s}, Key{%s}}", e.Action, e.Service, e.key) +} + +// Update() update the url with the merged URL. Work with Updated() can reduce the process of some merging URL. +func (e *ServiceEvent) Update(url *common.URL) { + e.Service = url + e.updated = true +} + +// Updated() check if the url is updated. +// If the serviceEvent is updated, then it don't need merge url again. +func (e *ServiceEvent) Updated() bool { + return e.updated +} + +// Key() generate the key for service.Key(). It is cached once. +func (e *ServiceEvent) Key() string { + if len(e.key) > 0 { + return e.key + } + e.key = e.Service.Key() + return e.key } // ServiceInstancesChangedEvent represents service instances make some changing diff --git a/registry/event/event_publishing_service_deiscovery_test.go b/registry/event/event_publishing_service_deiscovery_test.go index 54752c03c0de598226270b27c8d7d0f3621d07d1..504f7b5faed374795bd534c9e97cf5b42fc94d4c 100644 --- a/registry/event/event_publishing_service_deiscovery_test.go +++ b/registry/event/event_publishing_service_deiscovery_test.go @@ -24,7 +24,7 @@ import ( import ( gxset "github.com/dubbogo/gost/container/set" - gxpage "github.com/dubbogo/gost/page" + gxpage "github.com/dubbogo/gost/hash/page" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" ) diff --git a/registry/event/event_publishing_service_discovery.go b/registry/event/event_publishing_service_discovery.go index 3ee2f4a44946065cdf7489abc391df41f251d810..773eee6e83c6b3e24c293053b55b028d0e7b2e9a 100644 --- a/registry/event/event_publishing_service_discovery.go +++ b/registry/event/event_publishing_service_discovery.go @@ -19,7 +19,7 @@ package event import ( gxset "github.com/dubbogo/gost/container/set" - gxpage "github.com/dubbogo/gost/page" + gxpage "github.com/dubbogo/gost/hash/page" ) import ( diff --git a/registry/file/service_discovery.go b/registry/file/service_discovery.go index 254c12688f47282343e0004dac86844ba51a3eb2..768a1c2a3d8a208d637e374632da530a43465a4e 100644 --- a/registry/file/service_discovery.go +++ b/registry/file/service_discovery.go @@ -28,7 +28,7 @@ import ( import ( gxset "github.com/dubbogo/gost/container/set" - gxpage "github.com/dubbogo/gost/page" + gxpage "github.com/dubbogo/gost/hash/page" perrors "github.com/pkg/errors" ) @@ -69,7 +69,7 @@ func newFileSystemServiceDiscovery(name string) (registry.ServiceDiscovery, erro fdcf := extension.GetConfigCenterFactory(constant.FILE_KEY) p := path.Join(rp, ".dubbo", constant.REGISTRY_KEY) url, _ := common.NewURL("") - url.AddParamAvoidNil(file.CONFIG_CENTER_DIR_PARAM_NAME, p) + url.AddParamAvoidNil(file.ConfigCenterDirParamName, p) c, err := fdcf.GetDynamicConfiguration(url) if err != nil { return nil, perrors.WithStack(err) @@ -82,7 +82,9 @@ func newFileSystemServiceDiscovery(name string) (registry.ServiceDiscovery, erro } extension.AddCustomShutdownCallback(func() { - sd.Destroy() + if err := sd.Destroy(); err != nil { + logger.Warnf("sd.Destroy() = error:%v", err) + } }) for _, v := range sd.GetServices().Values() { @@ -210,7 +212,7 @@ func (fssd *fileSystemServiceDiscovery) GetInstances(serviceName string) []regis if err != nil { logger.Errorf("[FileServiceDiscovery] Could not query the instances for service{%s}, error = err{%v} ", serviceName, err) - return make([]registry.ServiceInstance, 0, 0) + return make([]registry.ServiceInstance, 0) } res := make([]registry.ServiceInstance, 0, set.Size()) @@ -221,7 +223,7 @@ func (fssd *fileSystemServiceDiscovery) GetInstances(serviceName string) []regis logger.Errorf("[FileServiceDiscovery] Could not get the properties for id{%s}, service{%s}, "+ "error = err{%v} ", id, serviceName, err) - return make([]registry.ServiceInstance, 0, 0) + return make([]registry.ServiceInstance, 0) } dsi := ®istry.DefaultServiceInstance{} @@ -230,7 +232,7 @@ func (fssd *fileSystemServiceDiscovery) GetInstances(serviceName string) []regis logger.Errorf("[FileServiceDiscovery] Could not unmarshal the properties for id{%s}, service{%s}, "+ "error = err{%v} ", id, serviceName, err) - return make([]registry.ServiceInstance, 0, 0) + return make([]registry.ServiceInstance, 0) } res = append(res, dsi) diff --git a/registry/file/service_discovery_test.go b/registry/file/service_discovery_test.go index 0bffcae31d039a49d8cf696a6de2f6858c42ada2..0062eae32cc04fd58ae4398ac7a28aabc54892c1 100644 --- a/registry/file/service_discovery_test.go +++ b/registry/file/service_discovery_test.go @@ -44,7 +44,10 @@ func TestNewFileSystemServiceDiscoveryAndDestroy(t *testing.T) { serviceDiscovery, err := newFileSystemServiceDiscovery(testName) assert.NoError(t, err) assert.NotNil(t, serviceDiscovery) - defer serviceDiscovery.Destroy() + defer func() { + err = serviceDiscovery.Destroy() + assert.Nil(t, err) + }() } func TestCURDFileSystemServiceDiscovery(t *testing.T) { @@ -78,8 +81,11 @@ func TestCURDFileSystemServiceDiscovery(t *testing.T) { assert.NoError(t, err) err = serviceDiscovery.Register(r1) - - defer serviceDiscovery.Destroy() + assert.NoError(t, err) + defer func() { + err = serviceDiscovery.Destroy() + assert.NoError(t, err) + }() } func prepareData() { diff --git a/registry/kubernetes/listener_test.go b/registry/kubernetes/listener_test.go index f1d8ff41761a841aa2bec888336756854ff16874..ef6e8fb1fceed9aa84a0f9099b8c782ceb624910 100644 --- a/registry/kubernetes/listener_test.go +++ b/registry/kubernetes/listener_test.go @@ -31,138 +31,6 @@ import ( "github.com/apache/dubbo-go/remoting" ) -var clientPodJsonData = `{ - "apiVersion": "v1", - "kind": "Pod", - "metadata": { - "annotations": { - "dubbo.io/annotation": "W3siayI6Ii9kdWJibyIsInYiOiIifSx7ImsiOiIvZHViYm8vY29tLmlrdXJlbnRvLnVzZXIuVXNlclByb3ZpZGVyIiwidiI6IiJ9LHsiayI6Ii9kdWJiby9jb20uaWt1cmVudG8udXNlci5Vc2VyUHJvdmlkZXIvY29uc3VtZXJzIiwidiI6IiJ9LHsiayI6Ii9kdWJibyIsInYiOiIifSx7ImsiOiIvZHViYm8vY29tLmlrdXJlbnRvLnVzZXIuVXNlclByb3ZpZGVyIiwidiI6IiJ9LHsiayI6Ii9kdWJiby9jb20uaWt1cmVudG8udXNlci5Vc2VyUHJvdmlkZXIvcHJvdmlkZXJzIiwidiI6IiJ9LHsiayI6Ii9kdWJiby9jb20uaWt1cmVudG8udXNlci5Vc2VyUHJvdmlkZXIvY29uc3VtZXJzL2NvbnN1bWVyJTNBJTJGJTJGMTcyLjE3LjAuOCUyRlVzZXJQcm92aWRlciUzRmNhdGVnb3J5JTNEY29uc3VtZXJzJTI2ZHViYm8lM0RkdWJib2dvLWNvbnN1bWVyLTIuNi4wJTI2cHJvdG9jb2wlM0RkdWJibyIsInYiOiIifV0=" - }, - "creationTimestamp": "2020-03-13T03:38:57Z", - "labels": { - "dubbo.io/label": "dubbo.io-value" - }, - "name": "client", - "namespace": "default", - "resourceVersion": "2449700", - "selfLink": "/api/v1/namespaces/default/pods/client", - "uid": "3ec394f5-dcc6-49c3-8061-57b4b2b41344" - }, - "spec": { - "containers": [ - { - "env": [ - { - "name": "NAMESPACE", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "metadata.namespace" - } - } - } - ], - "image": "registry.cn-hangzhou.aliyuncs.com/scottwang/dubbogo-client", - "imagePullPolicy": "Always", - "name": "client", - "resources": {}, - "terminationMessagePath": "/dev/termination-log", - "terminationMessagePolicy": "File", - "volumeMounts": [ - { - "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount", - "name": "dubbo-sa-token-l2lzh", - "readOnly": true - } - ] - } - ], - "dnsPolicy": "ClusterFirst", - "enableServiceLinks": true, - "nodeName": "minikube", - "priority": 0, - "restartPolicy": "Never", - "schedulerName": "default-scheduler", - "securityContext": {}, - "serviceAccount": "dubbo-sa", - "serviceAccountName": "dubbo-sa", - "terminationGracePeriodSeconds": 30, - "tolerations": [ - { - "effect": "NoExecute", - "key": "node.kubernetes.io/not-ready", - "operator": "Exists", - "tolerationSeconds": 300 - }, - { - "effect": "NoExecute", - "key": "node.kubernetes.io/unreachable", - "operator": "Exists", - "tolerationSeconds": 300 - } - ], - "volumes": [ - { - "name": "dubbo-sa-token-l2lzh", - "secret": { - "defaultMode": 420, - "secretName": "dubbo-sa-token-l2lzh" - } - } - ] - }, - "status": { - "conditions": [ - { - "lastProbeTime": null, - "lastTransitionTime": "2020-03-13T03:38:57Z", - "status": "True", - "type": "Initialized" - }, - { - "lastProbeTime": null, - "lastTransitionTime": "2020-03-13T03:40:18Z", - "status": "True", - "type": "Ready" - }, - { - "lastProbeTime": null, - "lastTransitionTime": "2020-03-13T03:40:18Z", - "status": "True", - "type": "ContainersReady" - }, - { - "lastProbeTime": null, - "lastTransitionTime": "2020-03-13T03:38:57Z", - "status": "True", - "type": "PodScheduled" - } - ], - "containerStatuses": [ - { - "containerID": "docker://2870d6abc19ca7fe22ca635ebcfac5d48c6d5550a659bafd74fb48104f6dfe3c", - "image": "registry.cn-hangzhou.aliyuncs.com/scottwang/dubbogo-client:latest", - "imageID": "docker-pullable://registry.cn-hangzhou.aliyuncs.com/scottwang/dubbogo-client@sha256:1f075131f708a0d400339e81549d7c4d4ed917ab0b6bd38ef458dd06ad25a559", - "lastState": {}, - "name": "client", - "ready": true, - "restartCount": 0, - "state": { - "running": { - "startedAt": "2020-03-13T03:40:17Z" - } - } - } - ], - "hostIP": "10.0.2.15", - "phase": "Running", - "podIP": "172.17.0.8", - "qosClass": "BestEffort", - "startTime": "2020-03-13T03:38:57Z" - } -} -` - func Test_DataChange(t *testing.T) { listener := NewRegistryDataListener(&MockDataListener{}) url, _ := common.NewURL("jsonrpc%3A%2F%2F127.0.0.1%3A20001%2Fcom.ikurento.user.UserProvider%3Fanyhost%3Dtrue%26app.version%3D0.0.1%26application%3DBDTService%26category%3Dproviders%26cluster%3Dfailover%26dubbo%3Ddubbo-provider-golang-2.6.0%26environment%3Ddev%26group%3D%26interface%3Dcom.ikurento.user.UserProvider%26ip%3D10.32.20.124%26loadbalance%3Drandom%26methods.GetUser.loadbalance%3Drandom%26methods.GetUser.retries%3D1%26methods.GetUser.weight%3D0%26module%3Ddubbogo%2Buser-info%2Bserver%26name%3DBDTService%26organization%3Dikurento.com%26owner%3DZX%26pid%3D74500%26retries%3D0%26service.filter%3Decho%26side%3Dprovider%26timestamp%3D1560155407%26version%3D%26warmup%3D100") diff --git a/registry/kubernetes/registry.go b/registry/kubernetes/registry.go index c1e559e48dcc64972c9405e15405d7e6febcc845..c4a0352cfaa3273c92296be6279c0aae71f0448b 100644 --- a/registry/kubernetes/registry.go +++ b/registry/kubernetes/registry.go @@ -19,7 +19,6 @@ package kubernetes import ( "fmt" - "os" "path" "sync" "time" @@ -40,11 +39,6 @@ import ( "github.com/apache/dubbo-go/remoting/kubernetes" ) -var ( - processID = "" - localIP = "" -) - const ( Name = "kubernetes" ConnDelay = 3 @@ -52,8 +46,8 @@ const ( ) func init() { - processID = fmt.Sprintf("%d", os.Getpid()) - localIP = common.GetLocalIp() + //processID = fmt.Sprintf("%d", os.Getpid()) + //localIP = common.GetLocalIp() extension.SetRegistry(Name, newKubernetesRegistry) } diff --git a/registry/kubernetes/registry_test.go b/registry/kubernetes/registry_test.go index 9fb409a222be914cad5b64e7ff3aab9bc97a6f33..a816b035c593b444665d3f259b17af1d4e5d53eb 100644 --- a/registry/kubernetes/registry_test.go +++ b/registry/kubernetes/registry_test.go @@ -280,7 +280,7 @@ func TestSubscribe(t *testing.T) { defer wg.Done() registerErr := r.Register(url) if registerErr != nil { - t.Fatal(registerErr) + t.Error(registerErr) } }() diff --git a/registry/mock_registry.go b/registry/mock_registry.go index 18c87ee3ace79d98c0d0faa6e915dd64d2fe5362..6287bb0d168f18f166618b7c6505b2f8b012be04 100644 --- a/registry/mock_registry.go +++ b/registry/mock_registry.go @@ -18,6 +18,7 @@ package registry import ( + "fmt" "time" ) @@ -32,14 +33,16 @@ import ( // MockRegistry is used as mock registry type MockRegistry struct { - listener *listener - destroyed *atomic.Bool + listener *listener + destroyed *atomic.Bool + allAddress chan []*ServiceEvent } // NewMockRegistry creates a mock registry func NewMockRegistry(url *common.URL) (Registry, error) { registry := &MockRegistry{ - destroyed: atomic.NewBool(false), + destroyed: atomic.NewBool(false), + allAddress: make(chan []*ServiceEvent), } listener := &listener{count: 0, registry: registry, listenChan: make(chan *ServiceEvent)} registry.listener = listener @@ -80,22 +83,12 @@ func (r *MockRegistry) subscribe(*common.URL) (Listener, error) { func (r *MockRegistry) Subscribe(url *common.URL, notifyListener NotifyListener) error { go func() { for { - if !r.IsAvailable() { - logger.Warnf("event listener game over.") - time.Sleep(time.Duration(3) * time.Second) - return - } - - listener, err := r.subscribe(url) - if err != nil { - if !r.IsAvailable() { - logger.Warnf("event listener game over.") - return - } - time.Sleep(time.Duration(3) * time.Second) + t, listener := r.checkLoopSubscribe(url) + if t == 0 { continue + } else if t == -1 { + return } - for { serviceEvent, err := listener.Next() if err != nil { @@ -109,6 +102,26 @@ func (r *MockRegistry) Subscribe(url *common.URL, notifyListener NotifyListener) } } }() + go func() { + for { + t, _ := r.checkLoopSubscribe(url) + if t == 0 { + continue + } else if t == -1 { + return + } + + for { + select { + case e := <-r.allAddress: + notifyListener.NotifyAll(e, func() { + fmt.Print("notify all ok") + }) + break + } + } + } + }() return nil } @@ -124,10 +137,7 @@ type listener struct { } func (l *listener) Next() (*ServiceEvent, error) { - select { - case e := <-l.listenChan: - return e, nil - } + return <-l.listenChan, nil } func (*listener) Close() { @@ -138,3 +148,27 @@ func (*listener) Close() { func (r *MockRegistry) MockEvent(event *ServiceEvent) { r.listener.listenChan <- event } + +// nolint +func (r *MockRegistry) MockEvents(events []*ServiceEvent) { + r.allAddress <- events +} + +func (r *MockRegistry) checkLoopSubscribe(url *common.URL) (int, Listener) { + if !r.IsAvailable() { + logger.Warnf("event listener game over.") + time.Sleep(time.Duration(3) * time.Second) + return -1, nil + } + + listener, err := r.subscribe(url) + if err != nil { + if !r.IsAvailable() { + logger.Warnf("event listener game over.") + return -1, nil + } + time.Sleep(time.Duration(3) * time.Second) + return 0, nil + } + return 1, listener +} diff --git a/registry/nacos/listener.go b/registry/nacos/listener.go index 7f27326d6d7b1000688cb03cd6406ea53745a119..6783bf4684c09808326f04ee8ffb7c993045c896 100644 --- a/registry/nacos/listener.go +++ b/registry/nacos/listener.go @@ -188,7 +188,9 @@ func (nl *nacosListener) startListen() error { } serviceName := getSubscribeName(nl.listenUrl) nl.subscribeParam = &vo.SubscribeParam{ServiceName: serviceName, SubscribeCallback: nl.Callback} - go nl.namingClient.Subscribe(nl.subscribeParam) + go func() { + _ = nl.namingClient.Subscribe(nl.subscribeParam) + }() return nil } diff --git a/registry/nacos/registry.go b/registry/nacos/registry.go index ae2345e6d5c90fcfc5c4dfb5b4da07bcf1b6f43e..de68e74906ecf14330d12bfb0ae42e86648ff9e3 100644 --- a/registry/nacos/registry.go +++ b/registry/nacos/registry.go @@ -274,7 +274,7 @@ func getNacosConfig(url *common.URL) (map[string]interface{}, error) { Port: uint64(port), }) } - configMap["serverConfigs"] = serverConfigs + configMap[nacosConstant.KEY_SERVER_CONFIGS] = serverConfigs var clientConfig nacosConstant.ClientConfig timeout, err := time.ParseDuration(url.GetParam(constant.REGISTRY_TIMEOUT_KEY, constant.DEFAULT_REG_TIMEOUT)) @@ -287,8 +287,16 @@ func getNacosConfig(url *common.URL) (map[string]interface{}, error) { clientConfig.LogDir = url.GetParam(constant.NACOS_LOG_DIR_KEY, "") clientConfig.Endpoint = url.GetParam(constant.NACOS_ENDPOINT, "") clientConfig.NamespaceId = url.GetParam(constant.NACOS_NAMESPACE_ID, "") - clientConfig.NotLoadCacheAtStart = true - configMap["clientConfig"] = clientConfig + + //enable local cache when nacos can not connect. + notLoadCache, err := strconv.ParseBool(url.GetParam(constant.NACOS_NOT_LOAD_LOCAL_CACHE, "false")) + if err != nil { + logger.Errorf("ParseBool - error: %v", err) + notLoadCache = false + } + clientConfig.NotLoadCacheAtStart = notLoadCache + + configMap[nacosConstant.KEY_CLIENT_CONFIG] = clientConfig return configMap, nil } diff --git a/registry/nacos/registry_test.go b/registry/nacos/registry_test.go index 43a6da79d13c0964162f60f45ed64a854d0e3a2c..b82820577144dfe98492165372a925500c20abfb 100644 --- a/registry/nacos/registry_test.go +++ b/registry/nacos/registry_test.go @@ -19,9 +19,11 @@ package nacos import ( "encoding/json" + "net/http" "net/url" "strconv" "testing" + "time" ) import ( @@ -35,7 +37,14 @@ import ( ) func TestNacosRegistry_Register(t *testing.T) { - regurl, _ := common.NewURL("registry://console.nacos.io:80", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) + if !checkNacosServerAlive() { + return + } + regurlMap := url.Values{} + regurlMap.Set(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER)) + regurlMap.Set(constant.NACOS_NOT_LOAD_LOCAL_CACHE, "true") + regurl, _ := common.NewURL("registry://console.nacos.io:80", common.WithParams(regurlMap)) + urlMap := url.Values{} urlMap.Set(constant.GROUP_KEY, "guangzhou-idc") urlMap.Set(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER)) @@ -64,7 +73,14 @@ func TestNacosRegistry_Register(t *testing.T) { } func TestNacosRegistry_Subscribe(t *testing.T) { - regurl, _ := common.NewURL("registry://console.nacos.io:80", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) + if !checkNacosServerAlive() { + return + } + regurlMap := url.Values{} + regurlMap.Set(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER)) + regurlMap.Set(constant.NACOS_NOT_LOAD_LOCAL_CACHE, "true") + regurl, _ := common.NewURL("registry://console.nacos.io:80", common.WithParams(regurlMap)) + urlMap := url.Values{} urlMap.Set(constant.GROUP_KEY, "guangzhou-idc") urlMap.Set(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER)) @@ -102,7 +118,14 @@ func TestNacosRegistry_Subscribe(t *testing.T) { } func TestNacosRegistry_Subscribe_del(t *testing.T) { - regurl, _ := common.NewURL("registry://console.nacos.io:80", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) + if !checkNacosServerAlive() { + return + } + regurlMap := url.Values{} + regurlMap.Set(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER)) + regurlMap.Set(constant.NACOS_NOT_LOAD_LOCAL_CACHE, "true") + regurl, _ := common.NewURL("registry://console.nacos.io:80", common.WithParams(regurlMap)) + urlMap := url.Values{} urlMap.Set(constant.GROUP_KEY, "guangzhou-idc") urlMap.Set(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER)) @@ -156,7 +179,9 @@ func TestNacosRegistry_Subscribe_del(t *testing.T) { nacosReg := reg.(*nacosRegistry) //deregister instance to mock instance offline - nacosReg.namingClient.DeregisterInstance(vo.DeregisterInstanceParam{Ip: "127.0.0.2", Port: 20000, ServiceName: "providers:com.ikurento.user.UserProvider:2.0.0:guangzhou-idc"}) + _, err = nacosReg.namingClient.DeregisterInstance(vo.DeregisterInstanceParam{Ip: "127.0.0.2", Port: 20000, + ServiceName: "providers:com.ikurento.user.UserProvider:2.0.0:guangzhou-idc"}) + assert.NoError(t, err) serviceEvent3, _ := listener.Next() assert.NoError(t, err) @@ -168,7 +193,11 @@ func TestNacosRegistry_Subscribe_del(t *testing.T) { } func TestNacosListener_Close(t *testing.T) { - regurl, _ := common.NewURL("registry://console.nacos.io:80", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) + regurlMap := url.Values{} + regurlMap.Set(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER)) + regurlMap.Set(constant.NACOS_NOT_LOAD_LOCAL_CACHE, "true") + regurl, _ := common.NewURL("registry://console.nacos.io:80", common.WithParams(regurlMap)) + urlMap := url.Values{} urlMap.Set(constant.GROUP_KEY, "guangzhou-idc") urlMap.Set(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER)) @@ -188,3 +217,11 @@ func TestNacosListener_Close(t *testing.T) { _, err = listener.Next() assert.NotNil(t, err) } + +func checkNacosServerAlive() bool { + c := http.Client{Timeout: time.Second} + if _, err := c.Get("http://console.nacos.io/nacos/"); err != nil { + return false + } + return true +} diff --git a/registry/nacos/service_discovery.go b/registry/nacos/service_discovery.go index 0e5ad8e6990856aeb0dfdde72f9c3f7fdae3e985..4533e7bc6b1427f1713e8b61bf2f125c0d0bde99 100644 --- a/registry/nacos/service_discovery.go +++ b/registry/nacos/service_discovery.go @@ -24,7 +24,7 @@ import ( import ( "github.com/dubbogo/gost/container/set" - "github.com/dubbogo/gost/page" + "github.com/dubbogo/gost/hash/page" "github.com/nacos-group/nacos-sdk-go/clients/naming_client" "github.com/nacos-group/nacos-sdk-go/model" "github.com/nacos-group/nacos-sdk-go/vo" @@ -141,8 +141,9 @@ func (n *nacosServiceDiscovery) GetInstances(serviceName string) []registry.Serv GroupName: n.group, }) if err != nil { - logger.Errorf("Could not query the instances for service: " + serviceName + ", group: " + n.group) - return make([]registry.ServiceInstance, 0, 0) + logger.Errorf("Could not query the instances for service: %+v, group: %+v . It happened err %+v", + serviceName, n.group, err) + return make([]registry.ServiceInstance, 0) } res := make([]registry.ServiceInstance, 0, len(instances)) for _, ins := range instances { @@ -174,7 +175,7 @@ func (n *nacosServiceDiscovery) GetInstancesByPage(serviceName string, offset in for i := offset; i < len(all) && i < offset+pageSize; i++ { res = append(res, all[i]) } - return gxpage.New(offset, pageSize, res, len(all)) + return gxpage.NewPage(offset, pageSize, res, len(all)) } // GetHealthyInstancesByPage will return the instance @@ -197,7 +198,7 @@ func (n *nacosServiceDiscovery) GetHealthyInstancesByPage(serviceName string, of } i++ } - return gxpage.New(offset, pageSize, res, len(all)) + return gxpage.NewPage(offset, pageSize, res, len(all)) } // GetRequestInstances will return the instances diff --git a/registry/nacos/service_discovery_test.go b/registry/nacos/service_discovery_test.go index 83bd210fd39835f8ffacea22edaaff6ba7c41a4e..aa044ad04a4f5d982914535a2f7fec55beed304c 100644 --- a/registry/nacos/service_discovery_test.go +++ b/registry/nacos/service_discovery_test.go @@ -81,6 +81,9 @@ func TestNacosServiceDiscovery_Destroy(t *testing.T) { } func TestNacosServiceDiscovery_CRUD(t *testing.T) { + if !checkNacosServerAlive() { + return + } prepareData() extension.SetEventDispatcher("mock", func() observer.EventDispatcher { return &dispatcher.MockEventDispatcher{} @@ -148,7 +151,8 @@ func TestNacosServiceDiscovery_CRUD(t *testing.T) { assert.Equal(t, 1, len(page.GetData())) instance = page.GetData()[0].(*registry.DefaultServiceInstance) - v, _ := instance.Metadata["a"] + v, ok := instance.Metadata["a"] + assert.True(t, ok) assert.Equal(t, "b", v) // test dispatcher event diff --git a/registry/protocol/protocol.go b/registry/protocol/protocol.go index e3af9ba97270c0c5981d1998c3db415f53a69ee7..4fcdf93c0fa36812b69daacbbc829ddac5d2e101 100644 --- a/registry/protocol/protocol.go +++ b/registry/protocol/protocol.go @@ -212,7 +212,11 @@ func (proto *registryProtocol) Export(invoker protocol.Invoker) protocol.Exporte logger.Infof("The exporter has not been cached, and will return a new exporter!") } - go reg.Subscribe(overriderUrl, overrideSubscribeListener) + go func() { + if err = reg.Subscribe(overriderUrl, overrideSubscribeListener); err != nil { + logger.Warnf("reg.subscribe(overriderUrl:%v) = error:%v", overriderUrl, err) + } + }() return cachedExporter.(protocol.Exporter) } @@ -240,18 +244,23 @@ func newOverrideSubscribeListener(overriderUrl *common.URL, invoker protocol.Inv } // Notify will be triggered when a service change notification is received. -func (nl *overrideSubscribeListener) Notify(events ...*registry.ServiceEvent) { - if len(events) == 0 { - return - } - - event := events[0] +func (nl *overrideSubscribeListener) Notify(event *registry.ServiceEvent) { if isMatched(event.Service, nl.url) && event.Action == remoting.EventTypeAdd { nl.configurator = extension.GetDefaultConfigurator(event.Service) nl.doOverrideIfNecessary() } } +func (nl *overrideSubscribeListener) NotifyAll(events []*registry.ServiceEvent, callback func()) { + defer callback() + if len(events) == 0 { + return + } + for _, e := range events { + nl.Notify(e) + } +} + func (nl *overrideSubscribeListener) doOverrideIfNecessary() { providerUrl := getProviderUrl(nl.originInvoker) key := getCacheKey(providerUrl) diff --git a/registry/registry.go b/registry/registry.go index 73940fa12acd195bd24c05b4ef22af70b92fc659..439178390a2fcedba3bd1c9919d9a797f44e3a21 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -72,7 +72,12 @@ type NotifyListener interface { // events are passed in, it's considered as a complete list, on the other side, if one single event is // passed in, then it's a incremental event. Pls. note when a list (instead of single event) comes, // the impl of NotifyListener may abandon the accumulated result from previous notifications. - Notify(...*ServiceEvent) + Notify(*ServiceEvent) + // NotifyAll the events are complete Service Event List. + // The argument of events []*ServiceEvent is equal to urls []*URL, The Action of serviceEvent should be EventTypeUpdate. + // If your registry center can only get all urls but can't get individual event, you should use this one. + // After notify the address, the callback func will be invoked. + NotifyAll([]*ServiceEvent, func()) } // Listener Deprecated! diff --git a/registry/service_discovery.go b/registry/service_discovery.go index cb7a3c0182ff88995ab9dd6c920523225c3cb36c..5ab768351508ed289cbe9b17a75ea9b8e95fff72 100644 --- a/registry/service_discovery.go +++ b/registry/service_discovery.go @@ -23,7 +23,7 @@ import ( import ( gxset "github.com/dubbogo/gost/container/set" - gxpage "github.com/dubbogo/gost/page" + gxpage "github.com/dubbogo/gost/hash/page" ) const DefaultPageSize = 100 diff --git a/registry/service_instance.go b/registry/service_instance.go index dbb458284d48aa350f2d5d3408b187b437ac81cd..43a1640eead7be1774556f25c9b8f97a75588801 100644 --- a/registry/service_instance.go +++ b/registry/service_instance.go @@ -91,7 +91,7 @@ func (d *DefaultServiceInstance) IsHealthy() bool { // GetMetadata will return the metadata, it will never return nil func (d *DefaultServiceInstance) GetMetadata() map[string]string { if d.Metadata == nil { - d.Metadata = make(map[string]string, 0) + d.Metadata = make(map[string]string) } return d.Metadata } diff --git a/registry/servicediscovery/service_discovery_registry.go b/registry/servicediscovery/service_discovery_registry.go index ad6ec981ded9e224cecc0fa37c8e7f8c0254a932..c97a7f7b51d2344f1a3fc0c59582e089f1e63b62 100644 --- a/registry/servicediscovery/service_discovery_registry.go +++ b/registry/servicediscovery/service_discovery_registry.go @@ -174,10 +174,6 @@ func (s *serviceDiscoveryRegistry) Register(url *common.URL) error { logger.Warnf("The URL[%s] has been registry!", url.String()) } - err = s.metaDataService.PublishServiceDefinition(url) - if err != nil { - return perrors.WithMessage(err, "publish the service definition failed. ") - } return s.serviceNameMapping.Map(url.GetParam(constant.INTERFACE_KEY, ""), url.GetParam(constant.GROUP_KEY, ""), url.GetParam(constant.Version, ""), @@ -462,7 +458,7 @@ func (s *serviceDiscoveryRegistry) initRevisionExportedURLsByInst(serviceInstanc } revisionExportedURLs := revisionExportedURLsMap[revision] firstGet := false - if revisionExportedURLs == nil || len(revisionExportedURLs) == 0 { + if len(revisionExportedURLs) == 0 { if len(revisionExportedURLsMap) > 0 { // The case is that current ServiceInstance with the different revision logger.Warnf("The ServiceInstance[id: %s, host : %s , port : %s] has different revision : %s"+ diff --git a/registry/servicediscovery/service_discovery_registry_test.go b/registry/servicediscovery/service_discovery_registry_test.go index ad6b73d3b4da77e5fe21a3085cdc21d3eca0246d..391d92c8ad19c871756ca7426531bb01a7d54876 100644 --- a/registry/servicediscovery/service_discovery_registry_test.go +++ b/registry/servicediscovery/service_discovery_registry_test.go @@ -23,7 +23,7 @@ import ( import ( "github.com/dubbogo/gost/container/set" - "github.com/dubbogo/gost/page" + "github.com/dubbogo/gost/hash/page" "github.com/stretchr/testify/assert" ) import ( @@ -79,18 +79,17 @@ func TestServiceDiscoveryRegistry_Register(t *testing.T) { registry, err := newServiceDiscoveryRegistry(registryURL) assert.Nil(t, err) assert.NotNil(t, registry) - registry.Register(url) + err = registry.Register(url) + assert.NoError(t, err) } type mockEventDispatcher struct { } func (m *mockEventDispatcher) AddEventListener(observer.EventListener) { - } func (m *mockEventDispatcher) AddEventListeners([]observer.EventListener) { - } func (m *mockEventDispatcher) RemoveEventListener(observer.EventListener) { diff --git a/registry/servicediscovery/synthesizer/rest/rest_subscribed_urls_synthesizer.go b/registry/servicediscovery/synthesizer/rest/rest_subscribed_urls_synthesizer.go index d1ab6113b31a779529cc7e33ffd0f14233dd9ad6..c6b3aeaad09ebfa01d832a92478b7638a6cff432 100644 --- a/registry/servicediscovery/synthesizer/rest/rest_subscribed_urls_synthesizer.go +++ b/registry/servicediscovery/synthesizer/rest/rest_subscribed_urls_synthesizer.go @@ -38,14 +38,11 @@ type RestSubscribedURLsSynthesizer struct { } func (r RestSubscribedURLsSynthesizer) Support(subscribedURL *common.URL) bool { - if "rest" == subscribedURL.Protocol { - return true - } - return false + return "rest" == subscribedURL.Protocol } func (r RestSubscribedURLsSynthesizer) Synthesize(subscribedURL *common.URL, serviceInstances []registry.ServiceInstance) []*common.URL { - urls := make([]*common.URL, len(serviceInstances), len(serviceInstances)) + urls := make([]*common.URL, len(serviceInstances)) for i, s := range serviceInstances { splitHost := strings.Split(s.GetHost(), ":") u := common.NewURLWithOptions(common.WithProtocol(subscribedURL.Protocol), common.WithIp(splitHost[0]), diff --git a/registry/zookeeper/registry.go b/registry/zookeeper/registry.go index fe492c2b12712e0935ccd6fdd264e0fe8f24e213..3232ee624de909320b129a15adebef5aec5108ac 100644 --- a/registry/zookeeper/registry.go +++ b/registry/zookeeper/registry.go @@ -129,7 +129,7 @@ func (r *zkRegistry) InitListeners() { defer oldDataListener.mutex.Unlock() r.dataListener.closed = true recovered := r.dataListener.subscribed - if recovered != nil && len(recovered) > 0 { + if len(recovered) > 0 { // recover all subscribed url for _, oldListener := range recovered { var ( @@ -251,8 +251,7 @@ func (r *zkRegistry) getListener(conf *common.URL) (*RegistryConfigurationListen dataListener.mutex.Lock() defer dataListener.mutex.Unlock() if r.dataListener.subscribed[conf.ServiceKey()] != nil { - - zkListener, _ := r.dataListener.subscribed[conf.ServiceKey()].(*RegistryConfigurationListener) + zkListener, _ = r.dataListener.subscribed[conf.ServiceKey()].(*RegistryConfigurationListener) if zkListener != nil { r.listenerLock.Lock() defer r.listenerLock.Unlock() @@ -284,7 +283,11 @@ func (r *zkRegistry) getListener(conf *common.URL) (*RegistryConfigurationListen //Interested register to dataconfig. r.dataListener.SubscribeURL(conf, zkListener) - go r.listener.ListenServiceEvent(conf, fmt.Sprintf("/dubbo/%s/"+constant.DEFAULT_CATEGORY, url.QueryEscape(conf.Service())), r.dataListener) + go r.listener.ListenServiceEvent( + conf, + fmt.Sprintf("/dubbo/%s/"+constant.DEFAULT_CATEGORY, url.QueryEscape(conf.Service())), + r.dataListener, + ) return zkListener, nil } @@ -295,9 +298,9 @@ func (r *zkRegistry) getCloseListener(conf *common.URL) (*RegistryConfigurationL r.dataListener.mutex.Lock() configurationListener := r.dataListener.subscribed[conf.ServiceKey()] if configurationListener != nil { - zkListener, _ := configurationListener.(*RegistryConfigurationListener) - if zkListener != nil { - if zkListener.isClosed { + rcListener, _ := configurationListener.(*RegistryConfigurationListener) + if rcListener != nil { + if rcListener.isClosed { r.dataListener.mutex.Unlock() return nil, perrors.New("configListener already been closed") } diff --git a/registry/zookeeper/registry_test.go b/registry/zookeeper/registry_test.go index e630db7e41092e48592bf99690f11863a23e23d3..5959a903bc883141f158c5462b0a775c711f8f51 100644 --- a/registry/zookeeper/registry_test.go +++ b/registry/zookeeper/registry_test.go @@ -34,11 +34,13 @@ import ( ) func Test_Register(t *testing.T) { - regurl, _ := common.NewURL("registry://127.0.0.1:1111", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) + regURL, _ := common.NewURL("registry://127.0.0.1:1111", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) url, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider", common.WithParamsValue(constant.CLUSTER_KEY, "mock"), common.WithParamsValue("serviceid", "soa.mock"), common.WithMethods([]string{"GetUser", "AddUser"})) - ts, reg, _ := newMockZkRegistry(regurl) - defer ts.Stop() + ts, reg, _ := newMockZkRegistry(regURL) + defer func() { + _ = ts.Stop() + }() err := reg.Register(url) children, _ := reg.client.GetChildren("/dubbo/com.ikurento.user.UserProvider/providers") assert.Regexp(t, ".*dubbo%3A%2F%2F127.0.0.1%3A20000%2Fcom.ikurento.user.UserProvider%3Fanyhost%3Dtrue%26cluster%3Dmock%26.*.serviceid%3Dsoa.mock", children) @@ -47,17 +49,21 @@ func Test_Register(t *testing.T) { func Test_UnRegister(t *testing.T) { // register - regurl, _ := common.NewURL("registry://127.0.0.1:1111", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) + regURL, _ := common.NewURL("registry://127.0.0.1:1111", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) url, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider", common.WithParamsValue(constant.CLUSTER_KEY, "mock"), common.WithParamsValue("serviceid", "soa.mock"), common.WithMethods([]string{"GetUser", "AddUser"})) - ts, reg, _ := newMockZkRegistry(regurl) - defer ts.Stop() + ts, reg, _ := newMockZkRegistry(regURL) + defer func() { + _ = ts.Stop() + }() err := reg.Register(url) + assert.NoError(t, err) children, _ := reg.client.GetChildren("/dubbo/com.ikurento.user.UserProvider/providers") assert.Regexp(t, ".*dubbo%3A%2F%2F127.0.0.1%3A20000%2Fcom.ikurento.user.UserProvider%3Fanyhost%3Dtrue%26cluster%3Dmock%26.*.serviceid%3Dsoa.mock", children) assert.NoError(t, err) err = reg.UnRegister(url) + assert.NoError(t, err) children, err = reg.client.GetChildren("/dubbo/com.ikurento.user.UserProvider/providers") assert.Equal(t, 0, len(children)) assert.Error(t, err) @@ -67,13 +73,12 @@ func Test_UnRegister(t *testing.T) { children, _ = reg.client.GetChildren("/dubbo/com.ikurento.user.UserProvider/providers") assert.Regexp(t, ".*dubbo%3A%2F%2F127.0.0.1%3A20000%2Fcom.ikurento.user.UserProvider%3Fanyhost%3Dtrue%26cluster%3Dmock%26.*.serviceid%3Dsoa.mock", children) assert.NoError(t, err) - } func Test_Subscribe(t *testing.T) { - regurl, _ := common.NewURL("registry://127.0.0.1:1111", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) + regURL, _ := common.NewURL("registry://127.0.0.1:1111", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) url, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider", common.WithParamsValue(constant.CLUSTER_KEY, "mock"), common.WithMethods([]string{"GetUser", "AddUser"})) - ts, reg, _ := newMockZkRegistry(regurl) + ts, reg, _ := newMockZkRegistry(regURL) //provider register err := reg.Register(url) @@ -84,10 +89,11 @@ func Test_Subscribe(t *testing.T) { } //consumer register - regurl.SetParam(constant.ROLE_KEY, strconv.Itoa(common.CONSUMER)) - _, reg2, _ := newMockZkRegistry(regurl, zookeeper.WithTestCluster(ts)) + regURL.SetParam(constant.ROLE_KEY, strconv.Itoa(common.CONSUMER)) + _, reg2, _ := newMockZkRegistry(regURL, zookeeper.WithTestCluster(ts)) - reg2.Register(url) + err = reg2.Register(url) + assert.Nil(t, err) listener, _ := reg2.DoSubscribe(url) serviceEvent, _ := listener.Next() @@ -96,13 +102,15 @@ func Test_Subscribe(t *testing.T) { return } assert.Regexp(t, ".*ServiceEvent{Action{add}.*", serviceEvent.String()) - defer ts.Stop() + defer func() { + _ = ts.Stop() + }() } func Test_UnSubscribe(t *testing.T) { - regurl, _ := common.NewURL("registry://127.0.0.1:1111", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) + regURL, _ := common.NewURL("registry://127.0.0.1:1111", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) url, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider", common.WithParamsValue(constant.CLUSTER_KEY, "mock"), common.WithMethods([]string{"GetUser", "AddUser"})) - ts, reg, _ := newMockZkRegistry(regurl) + ts, reg, _ := newMockZkRegistry(regURL) //provider register err := reg.Register(url) @@ -113,10 +121,11 @@ func Test_UnSubscribe(t *testing.T) { } //consumer register - regurl.SetParam(constant.ROLE_KEY, strconv.Itoa(common.CONSUMER)) - _, reg2, _ := newMockZkRegistry(regurl, zookeeper.WithTestCluster(ts)) + regURL.SetParam(constant.ROLE_KEY, strconv.Itoa(common.CONSUMER)) + _, reg2, _ := newMockZkRegistry(regURL, zookeeper.WithTestCluster(ts)) - reg2.Register(url) + err = reg2.Register(url) + assert.Nil(t, err) listener, _ := reg2.DoSubscribe(url) serviceEvent, _ := listener.Next() @@ -126,18 +135,22 @@ func Test_UnSubscribe(t *testing.T) { } assert.Regexp(t, ".*ServiceEvent{Action{add}.*", serviceEvent.String()) - reg2.UnSubscribe(url, nil) + err = reg2.UnSubscribe(url, nil) + assert.Nil(t, err) assert.Nil(t, reg2.listener) - - defer ts.Stop() + defer func() { + _ = ts.Stop() + }() } -func Test_ConsumerDestory(t *testing.T) { - regurl, _ := common.NewURL("registry://127.0.0.1:1111", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.CONSUMER))) +func Test_ConsumerDestroy(t *testing.T) { + regURL, _ := common.NewURL("registry://127.0.0.1:1111", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.CONSUMER))) url, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider", common.WithParamsValue(constant.CLUSTER_KEY, "mock"), common.WithMethods([]string{"GetUser", "AddUser"})) - ts, reg, err := newMockZkRegistry(regurl) - defer ts.Stop() + ts, reg, err := newMockZkRegistry(regURL) + defer func() { + _ = ts.Stop() + }() assert.NoError(t, err) err = reg.Register(url) @@ -149,18 +162,20 @@ func Test_ConsumerDestory(t *testing.T) { time.Sleep(1e9) reg.Destroy() assert.Equal(t, false, reg.IsAvailable()) - } -func Test_ProviderDestory(t *testing.T) { - regurl, _ := common.NewURL("registry://127.0.0.1:1111", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) +func Test_ProviderDestroy(t *testing.T) { + regURL, _ := common.NewURL("registry://127.0.0.1:1111", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) url, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider", common.WithParamsValue(constant.CLUSTER_KEY, "mock"), common.WithMethods([]string{"GetUser", "AddUser"})) - ts, reg, err := newMockZkRegistry(regurl) - defer ts.Stop() + ts, reg, err := newMockZkRegistry(regURL) + defer func() { + _ = ts.Stop() + }() assert.NoError(t, err) - reg.Register(url) + err = reg.Register(url) + assert.Nil(t, err) //listener.Close() time.Sleep(1e9) diff --git a/registry/zookeeper/service_discovery.go b/registry/zookeeper/service_discovery.go index 6d9582f33a7b2517c4edc96d00d00ad6b57a4835..095a78dc3c1650197ba1ded75218e8fd0020b6ea 100644 --- a/registry/zookeeper/service_discovery.go +++ b/registry/zookeeper/service_discovery.go @@ -27,7 +27,7 @@ import ( import ( "github.com/dubbogo/gost/container/set" - "github.com/dubbogo/gost/page" + "github.com/dubbogo/gost/hash/page" perrors "github.com/pkg/errors" ) @@ -60,9 +60,9 @@ func init() { } type zookeeperServiceDiscovery struct { - client *zookeeper.ZookeeperClient - csd *curator_discovery.ServiceDiscovery - listener *zookeeper.ZkEventListener + client *zookeeper.ZookeeperClient + csd *curator_discovery.ServiceDiscovery + //listener *zookeeper.ZkEventListener url *common.URL wg sync.WaitGroup cltLock sync.Mutex @@ -214,7 +214,7 @@ func (zksd *zookeeperServiceDiscovery) GetInstances(serviceName string) []regist if err != nil { logger.Errorf("[zkServiceDiscovery] Could not query the instances for service{%s}, error = err{%v} ", serviceName, err) - return make([]registry.ServiceInstance, 0, 0) + return make([]registry.ServiceInstance, 0) } iss := make([]registry.ServiceInstance, 0, len(criss)) for _, cris := range criss { @@ -231,7 +231,7 @@ func (zksd *zookeeperServiceDiscovery) GetInstancesByPage(serviceName string, of for i := offset; i < len(all) && i < offset+pageSize; i++ { res = append(res, all[i]) } - return gxpage.New(offset, pageSize, res, len(all)) + return gxpage.NewPage(offset, pageSize, res, len(all)) } // GetHealthyInstancesByPage will return the instance @@ -254,7 +254,7 @@ func (zksd *zookeeperServiceDiscovery) GetHealthyInstancesByPage(serviceName str } i++ } - return gxpage.New(offset, pageSize, res, len(all)) + return gxpage.NewPage(offset, pageSize, res, len(all)) } // GetRequestInstances will return the instances diff --git a/registry/zookeeper/service_discovery_test.go b/registry/zookeeper/service_discovery_test.go index ea3c7ddd48adc0adc4162d8306d28283575f694a..c9e14afd50af36e5e729f0efb768b37c56f0adf3 100644 --- a/registry/zookeeper/service_discovery_test.go +++ b/registry/zookeeper/service_discovery_test.go @@ -75,10 +75,14 @@ func TestNewZookeeperServiceDiscovery(t *testing.T) { func TestCURDZookeeperServiceDiscovery(t *testing.T) { ts := prepareData(t) - defer ts.Stop() + defer func() { + _ = ts.Stop() + }() sd, err := newZookeeperServiceDiscovery(testName) assert.Nil(t, err) - defer sd.Destroy() + defer func() { + _ = sd.Destroy() + }() md := make(map[string]string) md["t1"] = "test1" err = sd.Register(®istry.DefaultServiceInstance{ @@ -140,10 +144,14 @@ func TestCURDZookeeperServiceDiscovery(t *testing.T) { func TestAddListenerZookeeperServiceDiscovery(t *testing.T) { ts := prepareData(t) - defer ts.Stop() + defer func() { + _ = ts.Stop() + }() sd, err := newZookeeperServiceDiscovery(testName) assert.Nil(t, err) - defer sd.Destroy() + defer func() { + _ = sd.Destroy() + }() err = sd.Register(®istry.DefaultServiceInstance{ Id: "testId", @@ -154,8 +162,6 @@ func TestAddListenerZookeeperServiceDiscovery(t *testing.T) { Healthy: true, Metadata: nil, }) - assert.Nil(t, err) - assert.Nil(t, err) wg := &sync.WaitGroup{} wg.Add(1) @@ -170,7 +176,7 @@ func TestAddListenerZookeeperServiceDiscovery(t *testing.T) { extension.SetAndInitGlobalDispatcher("direct") extension.GetGlobalDispatcher().AddEventListener(sicl) err = sd.AddListener(sicl) - assert.Nil(t, err) + assert.NoError(t, err) err = sd.Update(®istry.DefaultServiceInstance{ Id: "testId", @@ -181,6 +187,7 @@ func TestAddListenerZookeeperServiceDiscovery(t *testing.T) { Healthy: true, Metadata: nil, }) + assert.NoError(t, err) tn.wg.Wait() } diff --git a/remoting/etcdv3/client.go b/remoting/etcdv3/client.go index ebd454242d49ee82c81fe1a1fae1a19980c238a4..34ee31bd94afcc48776bfc81d73bbd5c87a2b7f8 100644 --- a/remoting/etcdv3/client.go +++ b/remoting/etcdv3/client.go @@ -416,7 +416,9 @@ func (c *Client) keepAliveKV(k string, v string) error { keepAlive, err := c.rawClient.KeepAlive(c.ctx, lease.ID) if err != nil || keepAlive == nil { - c.rawClient.Revoke(c.ctx, lease.ID) + if _, revokeErr := c.rawClient.Revoke(c.ctx, lease.ID); revokeErr != nil { + logger.Warnf("rawClient.Revoke() = error:%v", revokeErr) + } if err != nil { return perrors.WithMessage(err, "keep alive lease") } else { diff --git a/remoting/etcdv3/client_test.go b/remoting/etcdv3/client_test.go index 3de266f42ffbc69a1e2ba4662a9a9fff1d831cd4..787c24d45fba17584dbdd4cb6485cf31ad0e5d2c 100644 --- a/remoting/etcdv3/client_test.go +++ b/remoting/etcdv3/client_test.go @@ -108,7 +108,6 @@ func (suite *ClientTestSuite) SetupSuite() { } suite.etcd = e - return } // stop etcd server @@ -133,9 +132,9 @@ func (suite *ClientTestSuite) setUpClient() *Client { // set up a client for suite func (suite *ClientTestSuite) SetupTest() { c := suite.setUpClient() - c.CleanKV() + err := c.CleanKV() + suite.Nil(err) suite.client = c - return } func (suite *ClientTestSuite) TestClientClose() { @@ -298,7 +297,7 @@ func (suite *ClientTestSuite) TestClientWatch() { wc, err := c.watch(prefix) if err != nil { - t.Fatal(err) + t.Error(err) } events := make([]mvccpb.Event, 0) @@ -358,7 +357,7 @@ func (suite *ClientTestSuite) TestClientRegisterTemp() { completePath := path.Join("scott", "wang") wc, err := observeC.watch(completePath) if err != nil { - t.Fatal(err) + t.Error(err) } events := make([]mvccpb.Event, 0) diff --git a/remoting/etcdv3/listener.go b/remoting/etcdv3/listener.go index c66928a6367cb2449de79a51b59d122a74a79911..fd6f9585979fabeb86d7a74d5817b6992b6a0ad4 100644 --- a/remoting/etcdv3/listener.go +++ b/remoting/etcdv3/listener.go @@ -36,7 +36,7 @@ import ( // nolint type EventListener struct { client *Client - keyMapLock sync.Mutex + keyMapLock sync.RWMutex keyMap map[string]struct{} wg sync.WaitGroup } @@ -181,9 +181,9 @@ func timeSecondDuration(sec int) time.Duration { // --------> listenServiceNodeEvent func (l *EventListener) ListenServiceEvent(key string, listener remoting.DataListener) { - l.keyMapLock.Lock() + l.keyMapLock.RLock() _, ok := l.keyMap[key] - l.keyMapLock.Unlock() + l.keyMapLock.RUnlock() if ok { logger.Warnf("etcdv3 key %s has already been listened.", key) return diff --git a/remoting/getty/dubbo_codec_for_test.go b/remoting/getty/dubbo_codec_for_test.go index fca5da89643adee2f5e6c1e8dca8ec3da4c987e4..9afc18a9aaf477588a2fbf051096494b6f887fa2 100644 --- a/remoting/getty/dubbo_codec_for_test.go +++ b/remoting/getty/dubbo_codec_for_test.go @@ -99,7 +99,7 @@ func (c *DubboTestCodec) EncodeRequest(request *remoting.Request) (*bytes.Buffer return pkg.Marshal() } -// encode heartbeart request +// encode heartbeat request func (c *DubboTestCodec) encodeHeartbeartReqeust(request *remoting.Request) (*bytes.Buffer, error) { header := impl.DubboHeader{ Type: impl.PackageHeartbeat, @@ -171,10 +171,7 @@ func (c *DubboTestCodec) Decode(data []byte) (remoting.DecodeResult, int, error) } func (c *DubboTestCodec) isRequest(data []byte) bool { - if data[2]&byte(0x80) == 0x00 { - return false - } - return true + return data[2]&byte(0x80) != 0x00 } // decode request @@ -230,7 +227,6 @@ func (c *DubboTestCodec) decodeRequest(data []byte) (*remoting.Request, int, err func (c *DubboTestCodec) decodeResponse(data []byte) (*remoting.Response, int, error) { buf := bytes.NewBuffer(data) pkg := impl.NewDubboPackage(buf) - response := &remoting.Response{} err := pkg.Unmarshal() if err != nil { originErr := perrors.Cause(err) @@ -240,7 +236,7 @@ func (c *DubboTestCodec) decodeResponse(data []byte) (*remoting.Response, int, e } return nil, 0, perrors.WithStack(err) } - response = &remoting.Response{ + response := &remoting.Response{ ID: pkg.Header.ID, //Version: pkg.Header., SerialID: pkg.Header.SerialID, diff --git a/remoting/getty/getty_client.go b/remoting/getty/getty_client.go index e432ca55a9bfb32575fad183f93438b8cb7801fb..414f045d1e0da91de0b6a184bee10647d3648ff1 100644 --- a/remoting/getty/getty_client.go +++ b/remoting/getty/getty_client.go @@ -19,6 +19,7 @@ package getty import ( "math/rand" + "sync" "time" ) @@ -38,14 +39,12 @@ import ( ) var ( - errInvalidCodecType = perrors.New("illegal CodecType") - errInvalidAddress = perrors.New("remote address invalid or empty") errSessionNotExist = perrors.New("session not exist") errClientClosed = perrors.New("client closed") - errClientReadTimeout = perrors.New("client read timeout") + errClientReadTimeout = perrors.New("maybe the client read timeout or fail to decode tcp stream in Writer.Write") clientConf *ClientConfig - clientGrpool *gxsync.TaskPool + clientGrpool gxsync.GenericTaskPool ) // it is init client for single protocol. @@ -101,16 +100,13 @@ func SetClientConf(c ClientConfig) { } func setClientGrpool() { - if clientConf.GrPoolSize > 1 { - clientGrpool = gxsync.NewTaskPool(gxsync.WithTaskPoolTaskPoolSize(clientConf.GrPoolSize), gxsync.WithTaskPoolTaskQueueLength(clientConf.QueueLen), - gxsync.WithTaskPoolTaskQueueNumber(clientConf.QueueNumber)) - } + clientGrpool = gxsync.NewTaskPoolSimple(clientConf.GrPoolSize) } // Options : param config type Options struct { // connect timeout - // remove request timeout, it will be calulate for every request + // remove request timeout, it will be calculate for every request ConnectTimeout time.Duration // request timeout RequestTimeout time.Duration @@ -121,6 +117,7 @@ type Client struct { addr string opts Options conf ClientConfig + mux sync.RWMutex pool *gettyRPCClientPool codec remoting.Codec ExchangeClient *remoting.ExchangeClient @@ -166,10 +163,13 @@ func (c *Client) Connect(url *common.URL) error { // close network connection func (c *Client) Close() { - if c.pool != nil { - c.pool.close() - } + c.mux.Lock() + p := c.pool c.pool = nil + c.mux.Unlock() + if p != nil { + p.close() + } } // send request @@ -209,6 +209,11 @@ func (c *Client) IsAvailable() bool { } func (c *Client) selectSession(addr string) (*gettyRPCClient, getty.Session, error) { + c.mux.RLock() + defer c.mux.RUnlock() + if c.pool == nil { + return nil, nil, perrors.New("client pool have been closed") + } rpcClient, err := c.pool.getGettyRpcClient(addr) if err != nil { return nil, nil, perrors.WithStack(err) diff --git a/remoting/getty/getty_client_test.go b/remoting/getty/getty_client_test.go index 0b18e973cd2ea7a3f6aae59e822aaf68ee983331..c32e0c23f4b3705c3400a96a8bb1247c7e3eae40 100644 --- a/remoting/getty/getty_client_test.go +++ b/remoting/getty/getty_client_test.go @@ -87,7 +87,9 @@ func getClient(url *common.URL) *Client { exchangeClient := remoting.NewExchangeClient(url, client, 5*time.Second, false) client.SetExchangeClient(exchangeClient) - client.Connect(url) + if err := client.Connect(url); err != nil { + return nil + } return client } @@ -394,9 +396,11 @@ func InitTest(t *testing.T) (*Server, *common.URL) { "environment=dev&interface=com.ikurento.user.UserProvider&ip=127.0.0.1&methods=GetUser%2C&" + "module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&" + "side=provider&timeout=3000×tamp=1556509797245&bean.name=UserProvider") + assert.NoError(t, err) // init server userProvider := &UserProvider{} - common.ServiceMap.Register("", url.Protocol, "", "0.0.1", userProvider) + _, err = common.ServiceMap.Register("", url.Protocol, "", "0.0.1", userProvider) + assert.NoError(t, err) invoker := &proxy_factory.ProxyInvoker{ BaseInvoker: *protocol.NewBaseInvoker(url), } @@ -429,7 +433,7 @@ type ( } UserProvider struct { - user map[string]User + //user map[string]User } ) diff --git a/remoting/getty/getty_server.go b/remoting/getty/getty_server.go index 620a01d83b11e4dd4db0dc25bc8f5759d3a64579..4930a6ad0ee0dbcde50a16e8df6b6245fb87a617 100644 --- a/remoting/getty/getty_server.go +++ b/remoting/getty/getty_server.go @@ -41,8 +41,7 @@ import ( ) var ( - srvConf *ServerConfig - srvGrpool *gxsync.TaskPool + srvConf *ServerConfig ) func initServer(protocol string) { @@ -76,7 +75,6 @@ func initServer(protocol string) { if err := srvConf.CheckValidity(); err != nil { panic(err) } - SetServerGrpool() } // SetServerConfig set dubbo server config. @@ -87,7 +85,6 @@ func SetServerConfig(s ServerConfig) { logger.Warnf("[ServerConfig CheckValidity] error: %v", err) return } - SetServerGrpool() } // GetServerConfig get getty server config. @@ -95,17 +92,6 @@ func GetServerConfig() ServerConfig { return *srvConf } -// SetServerGrpool set getty server GrPool -func SetServerGrpool() { - if srvConf.GrPoolSize > 1 { - srvGrpool = gxsync.NewTaskPool( - gxsync.WithTaskPoolTaskPoolSize(srvConf.GrPoolSize), - gxsync.WithTaskPoolTaskQueueLength(srvConf.QueueLen), - gxsync.WithTaskPoolTaskQueueNumber(srvConf.QueueNumber), - ) - } -} - // Server define getty server type Server struct { conf ServerConfig @@ -151,16 +137,14 @@ func (s *Server) newSession(session getty.Session) error { session.SetMaxMsgLen(conf.GettySessionParam.MaxMsgLen) session.SetPkgHandler(NewRpcServerPackageHandler(s)) session.SetEventListener(s.rpcHandler) - session.SetWQLen(conf.GettySessionParam.PkgWQSize) session.SetReadTimeout(conf.GettySessionParam.tcpReadTimeout) session.SetWriteTimeout(conf.GettySessionParam.tcpWriteTimeout) session.SetCronPeriod((int)(conf.heartbeatPeriod.Nanoseconds() / 1e6)) session.SetWaitTime(conf.GettySessionParam.waitTimeout) logger.Debugf("server accepts new session:%s\n", session.Stat()) - session.SetTaskPool(srvGrpool) return nil } - if tcpConn, ok = session.Conn().(*net.TCPConn); !ok { + if _, ok = session.Conn().(*net.TCPConn); !ok { panic(fmt.Sprintf("%s, session.conn{%#v} is not tcp connection\n", session.Stat(), session.Conn())) } @@ -192,13 +176,11 @@ func (s *Server) newSession(session getty.Session) error { session.SetMaxMsgLen(conf.GettySessionParam.MaxMsgLen) session.SetPkgHandler(NewRpcServerPackageHandler(s)) session.SetEventListener(s.rpcHandler) - session.SetWQLen(conf.GettySessionParam.PkgWQSize) session.SetReadTimeout(conf.GettySessionParam.tcpReadTimeout) session.SetWriteTimeout(conf.GettySessionParam.tcpWriteTimeout) session.SetCronPeriod((int)(conf.heartbeatPeriod.Nanoseconds() / 1e6)) session.SetWaitTime(conf.GettySessionParam.waitTimeout) logger.Debugf("server accepts new session: %s", session.Stat()) - session.SetTaskPool(srvGrpool) return nil } @@ -210,17 +192,15 @@ func (s *Server) Start() { ) addr = s.addr + serverOpts := []getty.ServerOption{getty.WithLocalAddress(addr)} if s.conf.SSLEnabled { - tcpServer = getty.NewTCPServer( - getty.WithLocalAddress(addr), - getty.WithServerSslEnabled(s.conf.SSLEnabled), - getty.WithServerTlsConfigBuilder(config.GetServerTlsConfigBuilder()), - ) - } else { - tcpServer = getty.NewTCPServer( - getty.WithLocalAddress(addr), - ) + serverOpts = append(serverOpts, getty.WithServerSslEnabled(s.conf.SSLEnabled), + getty.WithServerTlsConfigBuilder(config.GetServerTlsConfigBuilder())) } + + serverOpts = append(serverOpts, getty.WithServerTaskPool(gxsync.NewTaskPoolSimple(s.conf.GrPoolSize))) + + tcpServer = getty.NewTCPServer(serverOpts...) tcpServer.RunEventLoop(s.newSession) logger.Debugf("s bind addr{%s} ok!", s.addr) s.tcpServer = tcpServer diff --git a/remoting/getty/listener.go b/remoting/getty/listener.go index b2f7790f2ffcab6832224e07219016cb46a3fa4d..fd4c4898f2a74fae0cca1cf6c2e86e3e2f75017e 100644 --- a/remoting/getty/listener.go +++ b/remoting/getty/listener.go @@ -101,7 +101,7 @@ func (h *RpcClientHandler) OnMessage(session getty.Session, pkg interface{}) { logger.Errorf("illegal package") return } - // get heartbeart request from server + // get heartbeat request from server if result.IsRequest { req := result.Result.(*remoting.Request) if req.Event { @@ -114,12 +114,12 @@ func (h *RpcClientHandler) OnMessage(session getty.Session, pkg interface{}) { reply(session, resp) return } - logger.Errorf("illegal request but not heartbeart. {%#v}", req) + logger.Errorf("illegal request but not heartbeat. {%#v}", req) return } h.timeoutTimes = 0 p := result.Result.(*remoting.Response) - // get heartbeart + // get heartbeat if p.Event { logger.Debugf("get rpc heartbeat response{%#v}", p) if p.Error != nil { @@ -138,7 +138,7 @@ func (h *RpcClientHandler) OnMessage(session getty.Session, pkg interface{}) { // OnCron check the session health periodic. if the session's sessionTimeout has reached, just close the session func (h *RpcClientHandler) OnCron(session getty.Session) { - rpcSession, err := h.conn.getClientRpcSession(session) + rs, err := h.conn.getClientRpcSession(session) if err != nil { logger.Errorf("client.getClientSession(session{%s}) = error{%v}", session.Stat(), perrors.WithStack(err)) @@ -146,7 +146,7 @@ func (h *RpcClientHandler) OnCron(session getty.Session) { } if h.conn.pool.rpcClient.conf.sessionTimeout.Nanoseconds() < time.Since(session.GetActive()).Nanoseconds() { logger.Warnf("session{%s} timeout{%s}, reqNum{%d}", - session.Stat(), time.Since(session.GetActive()).String(), rpcSession.reqNum) + session.Stat(), time.Since(session.GetActive()).String(), rs.reqNum) h.conn.removeSession(session) // -> h.conn.close() -> h.conn.pool.remove(h.conn) return } @@ -237,8 +237,8 @@ func (h *RpcServerHandler) OnMessage(session getty.Session, pkg interface{}) { } h.rwlock.Unlock() - decodeResult, ok := pkg.(remoting.DecodeResult) - if !ok { + decodeResult, drOK := pkg.(remoting.DecodeResult) + if !drOK { logger.Errorf("illegal package{%#v}", pkg) return } @@ -252,7 +252,7 @@ func (h *RpcServerHandler) OnMessage(session getty.Session, pkg interface{}) { res.Handle() return } - logger.Errorf("illegal package but not heartbeart. {%#v}", pkg) + logger.Errorf("illegal package but not heartbeat. {%#v}", pkg) return } req := decodeResult.Result.(*remoting.Request) diff --git a/remoting/getty/listener_test.go b/remoting/getty/listener_test.go index 7e7ac5fed440a02188057d520a944b48c8bf7b64..2700ed8cd8e03f0a37c2d978cd03932ef8d5f8cb 100644 --- a/remoting/getty/listener_test.go +++ b/remoting/getty/listener_test.go @@ -23,14 +23,14 @@ import ( ) import ( + "github.com/opentracing/opentracing-go" + "github.com/opentracing/opentracing-go/mocktracer" "github.com/stretchr/testify/assert" ) import ( "github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/protocol/invocation" - "github.com/opentracing/opentracing-go" - "github.com/opentracing/opentracing-go/mocktracer" ) // test rebuild the ctx @@ -47,7 +47,7 @@ func TestRebuildCtx(t *testing.T) { assert.Nil(t, ctx.Value(constant.TRACING_REMOTE_SPAN_CTX)) span, ctx := opentracing.StartSpanFromContext(ctx, "Test-Client") - + assert.NotNil(t, ctx) err := injectTraceCtx(span, inv) assert.NoError(t, err) @@ -63,7 +63,7 @@ func TestRebuildCtx(t *testing.T) { // Once we decided to transfer more context's key-value, we should change this. // now we only support rebuild the tracing context func rebuildCtx(inv *invocation.RPCInvocation) context.Context { - ctx := context.WithValue(context.Background(), "attachment", inv.Attachments()) + ctx := context.WithValue(context.Background(), constant.DubboCtxKey("attachment"), inv.Attachments()) // actually, if user do not use any opentracing framework, the err will not be nil. spanCtx, err := opentracing.GlobalTracer().Extract(opentracing.TextMap, diff --git a/remoting/getty/opentracing.go b/remoting/getty/opentracing.go index 7db733cbe919f2bef46cfc477bda836dc2da0d45..4ba4fde9d880dee8437f8bb3dfdfec910f96fdcc 100644 --- a/remoting/getty/opentracing.go +++ b/remoting/getty/opentracing.go @@ -35,14 +35,6 @@ func injectTraceCtx(currentSpan opentracing.Span, inv *invocation_impl.RPCInvoca return err } -func extractTraceCtx(inv *invocation_impl.RPCInvocation) (opentracing.SpanContext, error) { - traceAttachments := filterContext(inv.Attachments()) - // actually, if user do not use any opentracing framework, the err will not be nil. - spanCtx, err := opentracing.GlobalTracer().Extract(opentracing.TextMap, - opentracing.TextMapCarrier(traceAttachments)) - return spanCtx, err -} - func filterContext(attachments map[string]interface{}) map[string]string { var traceAttchment = make(map[string]string) for k, v := range attachments { diff --git a/remoting/getty/pool.go b/remoting/getty/pool.go index 9689175bcf9838de595f292779b099ae9615d8e8..2b1cdfe2f49bfee0d5291f2eaf4183db71b8aa31 100644 --- a/remoting/getty/pool.go +++ b/remoting/getty/pool.go @@ -60,21 +60,20 @@ func newGettyRPCClientConn(pool *gettyRPCClientPool, addr string) (*gettyRPCClie sslEnabled bool ) sslEnabled = pool.sslEnabled + clientOpts := []getty.ClientOption{ + getty.WithServerAddress(addr), + getty.WithConnectionNumber((int)(pool.rpcClient.conf.ConnectionNum)), + getty.WithReconnectInterval(pool.rpcClient.conf.ReconnectInterval), + } if sslEnabled { - gettyClient = getty.NewTCPClient( - getty.WithServerAddress(addr), - getty.WithConnectionNumber((int)(pool.rpcClient.conf.ConnectionNum)), - getty.WithReconnectInterval(pool.rpcClient.conf.ReconnectInterval), - getty.WithClientSslEnabled(pool.sslEnabled), - getty.WithClientTlsConfigBuilder(config.GetClientTlsConfigBuilder()), - ) - } else { - gettyClient = getty.NewTCPClient( - getty.WithServerAddress(addr), - getty.WithConnectionNumber((int)(pool.rpcClient.conf.ConnectionNum)), - getty.WithReconnectInterval(pool.rpcClient.conf.ReconnectInterval), - ) + clientOpts = append(clientOpts, getty.WithClientSslEnabled(pool.sslEnabled), getty.WithClientTlsConfigBuilder(config.GetClientTlsConfigBuilder())) + } + + if clientGrpool != nil { + clientOpts = append(clientOpts, getty.WithClientTaskPool(clientGrpool)) } + + gettyClient = getty.NewTCPClient(clientOpts...) c := &gettyRPCClient{ addr: addr, pool: pool, @@ -91,7 +90,7 @@ func newGettyRPCClientConn(pool *gettyRPCClientPool, addr string) (*gettyRPCClie break } - if time.Now().Sub(start) > connectTimeout { + if time.Since(start) > connectTimeout { c.gettyClient.Close() return nil, perrors.New(fmt.Sprintf("failed to create client connection to %s in %s", addr, connectTimeout)) } @@ -136,40 +135,44 @@ func (c *gettyRPCClient) newSession(session getty.Session) error { session.SetMaxMsgLen(conf.GettySessionParam.MaxMsgLen) session.SetPkgHandler(NewRpcClientPackageHandler(c.pool.rpcClient)) session.SetEventListener(NewRpcClientHandler(c)) - session.SetWQLen(conf.GettySessionParam.PkgWQSize) session.SetReadTimeout(conf.GettySessionParam.tcpReadTimeout) session.SetWriteTimeout(conf.GettySessionParam.tcpWriteTimeout) session.SetCronPeriod((int)(conf.heartbeatPeriod.Nanoseconds() / 1e6)) session.SetWaitTime(conf.GettySessionParam.waitTimeout) logger.Debugf("client new session:%s\n", session.Stat()) - session.SetTaskPool(clientGrpool) return nil } if tcpConn, ok = session.Conn().(*net.TCPConn); !ok { panic(fmt.Sprintf("%s, session.conn{%#v} is not tcp connection\n", session.Stat(), session.Conn())) } - tcpConn.SetNoDelay(conf.GettySessionParam.TcpNoDelay) - tcpConn.SetKeepAlive(conf.GettySessionParam.TcpKeepAlive) + if err := tcpConn.SetNoDelay(conf.GettySessionParam.TcpNoDelay); err != nil { + logger.Error("tcpConn.SetNoDelay() = error:%v", err) + } + if err := tcpConn.SetKeepAlive(conf.GettySessionParam.TcpKeepAlive); err != nil { + logger.Error("tcpConn.SetKeepAlive() = error:%v", err) + } if conf.GettySessionParam.TcpKeepAlive { - tcpConn.SetKeepAlivePeriod(conf.GettySessionParam.keepAlivePeriod) + if err := tcpConn.SetKeepAlivePeriod(conf.GettySessionParam.keepAlivePeriod); err != nil { + logger.Error("tcpConn.SetKeepAlivePeriod() = error:%v", err) + } + } + if err := tcpConn.SetReadBuffer(conf.GettySessionParam.TcpRBufSize); err != nil { + logger.Error("tcpConn.SetReadBuffer() = error:%v", err) + } + if err := tcpConn.SetWriteBuffer(conf.GettySessionParam.TcpWBufSize); err != nil { + logger.Error("tcpConn.SetWriteBuffer() = error:%v", err) } - tcpConn.SetReadBuffer(conf.GettySessionParam.TcpRBufSize) - tcpConn.SetWriteBuffer(conf.GettySessionParam.TcpWBufSize) session.SetName(conf.GettySessionParam.SessionName) session.SetMaxMsgLen(conf.GettySessionParam.MaxMsgLen) session.SetPkgHandler(NewRpcClientPackageHandler(c.pool.rpcClient)) session.SetEventListener(NewRpcClientHandler(c)) - session.SetWQLen(conf.GettySessionParam.PkgWQSize) session.SetReadTimeout(conf.GettySessionParam.tcpReadTimeout) session.SetWriteTimeout(conf.GettySessionParam.tcpWriteTimeout) session.SetCronPeriod((int)(conf.heartbeatPeriod.Nanoseconds() / 1e6)) session.SetWaitTime(conf.GettySessionParam.waitTimeout) logger.Debugf("client new session:%s\n", session.Stat()) - - session.SetTaskPool(clientGrpool) - return nil } @@ -260,33 +263,29 @@ func (c *gettyRPCClient) updateSession(session getty.Session) { func (c *gettyRPCClient) getClientRpcSession(session getty.Session) (rpcSession, error) { var ( - err error - rpcSession rpcSession + err error + rs rpcSession ) c.lock.RLock() defer c.lock.RUnlock() if c.sessions == nil { - return rpcSession, errClientClosed + return rs, errClientClosed } err = errSessionNotExist for _, s := range c.sessions { if s.session == session { - rpcSession = *s + rs = *s err = nil break } } - return rpcSession, perrors.WithStack(err) + return rs, perrors.WithStack(err) } func (c *gettyRPCClient) isAvailable() bool { - if c.selectSession() == nil { - return false - } - - return true + return c.selectSession() != nil } func (c *gettyRPCClient) close() error { @@ -304,9 +303,7 @@ func (c *gettyRPCClient) close() error { c.gettyClient = nil sessions = make([]*rpcSession, 0, len(c.sessions)) - for _, s := range c.sessions { - sessions = append(sessions, s) - } + sessions = append(sessions, c.sessions...) c.sessions = c.sessions[:0] }() @@ -359,16 +356,16 @@ func (p *gettyRPCClientPool) close() { } func (p *gettyRPCClientPool) getGettyRpcClient(addr string) (*gettyRPCClient, error) { - conn, err := p.get() - if err == nil && conn == nil { + conn, connErr := p.get() + if connErr == nil && conn == nil { // create new conn - rpcClientConn, err := newGettyRPCClientConn(p, addr) - if err == nil { + rpcClientConn, rpcErr := newGettyRPCClientConn(p, addr) + if rpcErr == nil { p.put(rpcClientConn) } - return rpcClientConn, perrors.WithStack(err) + return rpcClientConn, perrors.WithStack(rpcErr) } - return conn, perrors.WithStack(err) + return conn, perrors.WithStack(connErr) } func (p *gettyRPCClientPool) get() (*gettyRPCClient, error) { diff --git a/remoting/kubernetes/client.go b/remoting/kubernetes/client.go index fce9e80eb88b73cfbe96a4aaebeb106a902fe41d..ce6bcccea50643cd49f3f99fcf4b86e73309b28c 100644 --- a/remoting/kubernetes/client.go +++ b/remoting/kubernetes/client.go @@ -48,16 +48,16 @@ type Client struct { // newClient returns Client instance for registry func newClient(url *common.URL) (*Client, error) { - - ctx, cancel := context.WithCancel(context.Background()) - // read type r, err := strconv.Atoi(url.GetParams().Get(constant.ROLE_KEY)) if err != nil { return nil, perrors.WithMessage(err, "atoi role") } + ctx, cancel := context.WithCancel(context.Background()) + controller, err := newDubboRegistryController(ctx, common.RoleType(r), GetInClusterKubernetesClient) if err != nil { + cancel() return nil, perrors.WithMessage(err, "new dubbo-registry controller") } @@ -186,12 +186,12 @@ func ValidateClient(container clientFacade) error { // NewMockClient exports for registry package test func NewMockClient(podList *v1.PodList) (*Client, error) { - ctx, cancel := context.WithCancel(context.Background()) controller, err := newDubboRegistryController(ctx, common.CONSUMER, func() (kubernetes.Interface, error) { return fake.NewSimpleClientset(podList), nil }) if err != nil { + cancel() return nil, perrors.WithMessage(err, "new dubbo-registry controller") } diff --git a/remoting/kubernetes/client_test.go b/remoting/kubernetes/client_test.go index d6c5a2e88057459c0a87cd9a607e9c10970b07b2..9cc421225ea15c250c3ea1196432cb65635144a2 100644 --- a/remoting/kubernetes/client_test.go +++ b/remoting/kubernetes/client_test.go @@ -317,7 +317,8 @@ func TestClientGetChildrenKVList(t *testing.T) { wc, done, err := client.WatchWithPrefix(prefix) if err != nil { - t.Fatal(err) + t.Error(err) + return } wg.Done() @@ -365,7 +366,7 @@ func TestClientGetChildrenKVList(t *testing.T) { // start get all children kList, vList, err := client.GetChildren(prefix) if err != nil { - t.Fatal(err) + t.Error(err) } for i := 0; i < len(kList); i++ { @@ -392,7 +393,7 @@ func TestClientWatchPrefix(t *testing.T) { wc, done, err := client.WatchWithPrefix(prefix) if err != nil { - t.Fatal(err) + t.Error(err) } wg.Done() @@ -435,7 +436,7 @@ func TestClientWatch(t *testing.T) { wc, done, err := client.Watch(prefix) if err != nil { - t.Fatal(err) + t.Error(err) } wg.Done() diff --git a/remoting/kubernetes/facade_test.go b/remoting/kubernetes/facade_test.go index 00e2e1171c54c2b07973b66cb96cf64e67683f00..a6c6c02b515b6e1ebc815bb5b388ae68db68621d 100644 --- a/remoting/kubernetes/facade_test.go +++ b/remoting/kubernetes/facade_test.go @@ -19,7 +19,6 @@ package kubernetes import ( "strconv" - "sync" "testing" ) @@ -30,9 +29,9 @@ import ( type mockFacade struct { *common.URL - client *Client - cltLock sync.Mutex - done chan struct{} + client *Client + //cltLock sync.Mutex + //done chan struct{} } func (r *mockFacade) Client() *Client { diff --git a/remoting/kubernetes/registry_controller.go b/remoting/kubernetes/registry_controller.go index 20be0d72ec1ce4c379f44d3218ffbd0cfd3d2a63..f66163d3c68768e99a84fbca0110e099985429be 100644 --- a/remoting/kubernetes/registry_controller.go +++ b/remoting/kubernetes/registry_controller.go @@ -442,7 +442,7 @@ func (c *dubboRegistryController) initCurrentPod() error { return perrors.WithMessage(err, "get patch") } - currentPod, err = c.patchCurrentPod(p) + _, err = c.patchCurrentPod(p) if err != nil { return perrors.WithMessage(err, "patch to current pod") } diff --git a/remoting/kubernetes/watch.go b/remoting/kubernetes/watch.go index 07eeb09b4dd4627fdd3b18ee4d59356911b3a9b1..7bb5ef1754836b481089d67b9cf34437567ffa9a 100644 --- a/remoting/kubernetes/watch.go +++ b/remoting/kubernetes/watch.go @@ -116,21 +116,17 @@ type watcherSetImpl struct { // closeWatchers // when the watcher-set was closed func (s *watcherSetImpl) closeWatchers() { - - select { - case <-s.ctx.Done(): - - // parent ctx be canceled, close the watch-set's watchers - s.lock.Lock() - watchers := s.watchers - s.lock.Unlock() - - for _, w := range watchers { - // stop data stream - // close(w.ch) - // stop watcher - w.stop() - } + <-s.ctx.Done() + // parent ctx be canceled, close the watch-set's watchers + s.lock.Lock() + watchers := s.watchers + s.lock.Unlock() + + for _, w := range watchers { + // stop data stream + // close(w.ch) + // stop watcher + w.stop() } } diff --git a/remoting/kubernetes/watch_test.go b/remoting/kubernetes/watch_test.go index 8889103be212381c07ffff3c3d4399f41aeee564..efefcc5dc9db629aa0f109a8da4f4227c18504fa 100644 --- a/remoting/kubernetes/watch_test.go +++ b/remoting/kubernetes/watch_test.go @@ -42,7 +42,8 @@ func TestWatchSet(t *testing.T) { defer wg.Done() w, err := s.Watch("key-1", false) if err != nil { - t.Fatal(err) + t.Error(err) + return } for { select { @@ -64,7 +65,8 @@ func TestWatchSet(t *testing.T) { defer wg.Done() w, err := s.Watch("key", true) if err != nil { - t.Fatal(err) + t.Error(err) + return } for { @@ -86,7 +88,8 @@ func TestWatchSet(t *testing.T) { Key: "key-" + strconv.Itoa(i), Value: strconv.Itoa(i), }); err != nil { - t.Fatal(err) + t.Error(err) + return } }(i) } diff --git a/remoting/nacos/builder_test.go b/remoting/nacos/builder_test.go index 61d13ef26f9f1d17173bbeb11468f9babdade2f5..48199bea45b85a3929b174af21791e599284c57c 100644 --- a/remoting/nacos/builder_test.go +++ b/remoting/nacos/builder_test.go @@ -34,11 +34,13 @@ func TestNewNacosClient(t *testing.T) { client, err := NewNacosClient(rc) // address is nil + assert.Nil(t, client) assert.NotNil(t, err) rc.Address = "console.nacos.io:80:123" client, err = NewNacosClient(rc) // invalid address + assert.Nil(t, client) assert.NotNil(t, err) rc.Address = "console.nacos.io:80" diff --git a/remoting/zookeeper/client.go b/remoting/zookeeper/client.go index fbd90762eb34f361a38486ef2d8f5f10699a96f7..852a5564f955e9734be58515cf0e6840e69f2f78 100644 --- a/remoting/zookeeper/client.go +++ b/remoting/zookeeper/client.go @@ -128,18 +128,18 @@ func ValidateZookeeperClient(container ZkClientFacade, opts ...Option) error { if container.ZkClient() == nil { // in dubbo, every registry only connect one node, so this is []string{r.Address} - timeout, err := time.ParseDuration(url.GetParam(constant.REGISTRY_TIMEOUT_KEY, constant.DEFAULT_REG_TIMEOUT)) - if err != nil { - logger.Errorf("timeout config %v is invalid ,err is %v", - url.GetParam(constant.REGISTRY_TIMEOUT_KEY, constant.DEFAULT_REG_TIMEOUT), err.Error()) - return perrors.WithMessagef(err, "newZookeeperClient(address:%+v)", url.Location) + timeout, paramErr := time.ParseDuration(url.GetParam(constant.REGISTRY_TIMEOUT_KEY, constant.DEFAULT_REG_TIMEOUT)) + if paramErr != nil { + logger.Errorf("timeout config %v is invalid, err is %v", + url.GetParam(constant.REGISTRY_TIMEOUT_KEY, constant.DEFAULT_REG_TIMEOUT), paramErr.Error()) + return perrors.WithMessagef(paramErr, "newZookeeperClient(address:%+v)", url.Location) } zkAddresses := strings.Split(url.Location, ",") - newClient, err := NewZookeeperClient(options.zkName, zkAddresses, timeout) - if err != nil { + newClient, cltErr := NewZookeeperClient(options.zkName, zkAddresses, timeout) + if cltErr != nil { logger.Warnf("newZookeeperClient(name{%s}, zk address{%v}, timeout{%d}) = error{%v}", - options.zkName, url.Location, timeout.String(), err) - return perrors.WithMessagef(err, "newZookeeperClient(address:%+v)", url.Location) + options.zkName, url.Location, timeout.String(), cltErr) + return perrors.WithMessagef(cltErr, "newZookeeperClient(address:%+v)", url.Location) } container.SetZkClient(newClient) connected = true diff --git a/remoting/zookeeper/client_test.go b/remoting/zookeeper/client_test.go index 34741700ca2a9d86ee5321b0b19ed64b2b1a25a8..3d0949973d0aa01acf5178d20afb854debb5c763 100644 --- a/remoting/zookeeper/client_test.go +++ b/remoting/zookeeper/client_test.go @@ -81,7 +81,10 @@ func verifyEventStateOrder(t *testing.T, c <-chan zk.Event, expectedStates []zk. func Test_newMockZookeeperClient(t *testing.T) { ts, z, event, err := NewMockZookeeperClient("test", 15*time.Second) assert.NoError(t, err) - defer ts.Stop() + defer func() { + err := ts.Stop() + assert.Nil(t, err) + }() states := []zk.State{zk.StateConnecting, zk.StateConnected, zk.StateHasSession} verifyEventStateOrder(t, event, states, "event channel") @@ -92,7 +95,10 @@ func Test_newMockZookeeperClient(t *testing.T) { func TestCreate(t *testing.T) { ts, z, event, err := NewMockZookeeperClient("test", 15*time.Second) assert.NoError(t, err) - defer ts.Stop() + defer func() { + _ = ts.Stop() + assert.Nil(t, err) + }() err = z.Create("test1/test2/test3/test4") assert.NoError(t, err) @@ -103,7 +109,10 @@ func TestCreate(t *testing.T) { func TestCreateDelete(t *testing.T) { ts, z, event, err := NewMockZookeeperClient("test", 15*time.Second) assert.NoError(t, err) - defer ts.Stop() + defer func() { + _ = ts.Stop() + assert.Nil(t, err) + }() states := []zk.State{zk.StateConnecting, zk.StateConnected, zk.StateHasSession} verifyEventStateOrder(t, event, states, "event channel") @@ -117,7 +126,10 @@ func TestCreateDelete(t *testing.T) { func TestRegisterTemp(t *testing.T) { ts, z, event, err := NewMockZookeeperClient("test", 15*time.Second) assert.NoError(t, err) - defer ts.Stop() + defer func() { + _ = ts.Stop() + assert.Nil(t, err) + }() err = z.Create("/test1/test2/test3") assert.NoError(t, err) @@ -131,7 +143,10 @@ func TestRegisterTemp(t *testing.T) { func TestRegisterTempSeq(t *testing.T) { ts, z, event, err := NewMockZookeeperClient("test", 15*time.Second) assert.NoError(t, err) - defer ts.Stop() + defer func() { + _ = ts.Stop() + assert.Nil(t, err) + }() err = z.Create("/test1/test2/test3") assert.NoError(t, err) tmpath, err := z.RegisterTempSeq("/test1/test2/test3", []byte("test")) diff --git a/remoting/zookeeper/facade_test.go b/remoting/zookeeper/facade_test.go index 3d5798c947fb0fb33adce708e1bcdb8fb24e530f..4a76a80ef13edf9c38c2f54bbdca0b8c8203530f 100644 --- a/remoting/zookeeper/facade_test.go +++ b/remoting/zookeeper/facade_test.go @@ -88,7 +88,11 @@ func (r *mockFacade) IsAvailable() bool { func Test_Facade(t *testing.T) { ts, z, event, err := NewMockZookeeperClient("test", 15*time.Second) assert.NoError(t, err) - defer ts.Stop() + defer func() { + if err := ts.Stop(); err != nil { + t.Errorf("tc.Stop() = error: %v", err) + } + }() url, _ := common.NewURL("mock://127.0.0.1") mock := newMockFacade(z, url) go HandleClientRestart(mock) diff --git a/remoting/zookeeper/listener.go b/remoting/zookeeper/listener.go index e5ddcadeaca9c3ce972cbe781413ebec7393afce..3eda6d9698e5ec244bb6c5763ebc8e459e03310e 100644 --- a/remoting/zookeeper/listener.go +++ b/remoting/zookeeper/listener.go @@ -135,9 +135,10 @@ func (l *ZkEventListener) handleZkNodeEvent(zkPath string, children []string, li newChildren, err := l.client.GetChildren(zkPath) if err != nil { if err == errNilChildren { - content, _, err := l.client.Conn.Get(zkPath) - if err != nil { - logger.Errorf("Get new node path {%v} 's content error,message is {%v}", zkPath, perrors.WithStack(err)) + content, _, connErr := l.client.Conn.Get(zkPath) + if connErr != nil { + logger.Errorf("Get new node path {%v} 's content error,message is {%v}", + zkPath, perrors.WithStack(connErr)) } else { listener.DataChange(remoting.Event{Path: zkPath, Action: remoting.EventTypeUpdate, Content: string(content)}) } @@ -158,9 +159,10 @@ func (l *ZkEventListener) handleZkNodeEvent(zkPath string, children []string, li newNode = path.Join(zkPath, n) logger.Infof("add zkNode{%s}", newNode) - content, _, err := l.client.Conn.Get(newNode) - if err != nil { - logger.Errorf("Get new node path {%v} 's content error,message is {%v}", newNode, perrors.WithStack(err)) + content, _, connErr := l.client.Conn.Get(newNode) + if connErr != nil { + logger.Errorf("Get new node path {%v} 's content error,message is {%v}", + newNode, perrors.WithStack(connErr)) } if !listener.DataChange(remoting.Event{Path: zkPath, Action: remoting.EventTypeAdd, Content: string(content)}) { @@ -362,9 +364,9 @@ func (l *ZkEventListener) ListenServiceEvent(conf *common.URL, zkPath string, li }(zkPath, listener) } -func (l *ZkEventListener) valid() bool { - return l.client.ZkConnValid() -} +//func (l *ZkEventListener) valid() bool { +// return l.client.ZkConnValid() +//} // Close will let client listen exit func (l *ZkEventListener) Close() { diff --git a/remoting/zookeeper/listener_test.go b/remoting/zookeeper/listener_test.go index 37ef1b4b967d2f6708a4a099875ae90f273ae483..896bdc60702d17520c62cd0621b00da795c90e6d 100644 --- a/remoting/zookeeper/listener_test.go +++ b/remoting/zookeeper/listener_test.go @@ -95,7 +95,11 @@ func TestListener(t *testing.T) { ` var wait sync.WaitGroup ts, client, event := initZkData(t) - defer ts.Stop() + defer func() { + if err := ts.Stop(); err != nil { + t.Errorf("ts.Stop() = error: %v", err) + } + }() client.Wait.Add(1) wait.Add(1) go client.HandleZkEvent(event)