From 9a89e8d0a553a3b64098af774cbec60067e08e76 Mon Sep 17 00:00:00 2001 From: Sergei Sobolev Date: Tue, 17 Nov 2020 16:35:49 +0300 Subject: [PATCH 1/4] easyjson unmarshaling test --- Makefile | 3 + go.mod | 19 + go.sum | 404 ++++++++++++++++++ tests/unmarshalling/httpclient/builder.go | 49 +++ .../unmarshalling/httpclient/builder_test.go | 71 +++ tests/unmarshalling/httpclient/client.go | 66 +++ tests/unmarshalling/httpclient/client_test.go | 163 +++++++ tests/unmarshalling/httpclient/transport.go | 79 ++++ .../httpclient/transport_easyjson.go | 151 +++++++ tests/unmarshalling/httperrors/client.go | 54 +++ tests/unmarshalling/httperrors/ui.go | 82 ++++ tests/unmarshalling/httpserver/builder.go | 38 ++ tests/unmarshalling/httpserver/server.go | 56 +++ tests/unmarshalling/httpserver/transport.go | 97 +++++ .../httpserver/transport_easyjson.go | 151 +++++++ tests/unmarshalling/service.go | 48 +++ tests/unmarshalling/service_test.go | 88 ++++ 17 files changed, 1619 insertions(+) create mode 100644 go.mod create mode 100644 go.sum create mode 100644 tests/unmarshalling/httpclient/builder.go create mode 100644 tests/unmarshalling/httpclient/builder_test.go create mode 100644 tests/unmarshalling/httpclient/client.go create mode 100644 tests/unmarshalling/httpclient/client_test.go create mode 100644 tests/unmarshalling/httpclient/transport.go create mode 100644 tests/unmarshalling/httpclient/transport_easyjson.go create mode 100644 tests/unmarshalling/httperrors/client.go create mode 100644 tests/unmarshalling/httperrors/ui.go create mode 100644 tests/unmarshalling/httpserver/builder.go create mode 100644 tests/unmarshalling/httpserver/server.go create mode 100644 tests/unmarshalling/httpserver/transport.go create mode 100644 tests/unmarshalling/httpserver/transport_easyjson.go create mode 100644 tests/unmarshalling/service.go create mode 100644 tests/unmarshalling/service_test.go diff --git a/Makefile b/Makefile index ede6bd7..04efd99 100644 --- a/Makefile +++ b/Makefile @@ -22,3 +22,6 @@ help: @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' .DEFAULT_GOAL := help + +test: + go test -v ./tests/... diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..8ff10e2 --- /dev/null +++ b/go.mod @@ -0,0 +1,19 @@ +module github.com/wildberries-ru/go-transport-generator + +go 1.14 + +require ( + github.com/aws/aws-sdk-go v1.35.28 + github.com/buaazp/fasthttprouter v0.1.1 + github.com/bxcodec/faker/v3 v3.5.0 + github.com/fatih/structtag v1.2.0 // indirect + github.com/go-kit/kit v0.10.0 + github.com/mailru/easyjson v0.7.6 + github.com/pkg/errors v0.9.1 + github.com/prometheus/common v0.7.0 + github.com/stretchr/testify v1.6.1 + github.com/valyala/fasthttp v1.17.0 + github.com/vetcher/go-astra v1.2.0 + golang.org/x/mod v0.3.0 + gopkg.in/yaml.v2 v2.3.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..c602f2b --- /dev/null +++ b/go.sum @@ -0,0 +1,404 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= +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 h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/andybalholm/brotli v1.0.0 h1:7UCwP93aiSfvWpapti8g88vVVGp2qqtGyePsSuDafo4= +github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +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/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +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.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.35.28 h1:S2LuRnfC8X05zgZLC8gy/Sb82TGv2Cpytzbzz7tkeHc= +github.com/aws/aws-sdk-go v1.35.28/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +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/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/buaazp/fasthttprouter v0.1.1 h1:4oAnN0C3xZjylvZJdP35cxfclyn4TYkW6Y+DSvS+h8Q= +github.com/buaazp/fasthttprouter v0.1.1/go.mod h1:h/Ap5oRVLeItGKTVBb+heQPks+HdIUtGmI4H5WCYijM= +github.com/bxcodec/faker v1.5.0 h1:RIWOeAcM3ZHye1i8bQtHU2LfNOaLmHuRiCo60mNMOcQ= +github.com/bxcodec/faker v2.0.1+incompatible h1:P0KUpUw5w6WJXwrPfv35oc91i4d8nf40Nwln+M/+faA= +github.com/bxcodec/faker/v3 v3.5.0 h1:Rahy6dwbd6up0wbwbV7dFyQb+jmdC51kpATuUdnzfMg= +github.com/bxcodec/faker/v3 v3.5.0/go.mod h1:gF31YgnMSMKgkvl+fyEo1xuSMbEuieyqfeslGYFjneM= +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/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +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/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/coreos/go-semver v0.2.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/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +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/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= +github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= +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/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +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 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +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= +github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +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/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/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-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +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/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +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/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +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-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/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +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/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/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +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/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/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.10.7 h1:7rix8v8GpI3ZBb0nSozFRgbtXKv+hOe+qfEpZqybrAg= +github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +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/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +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-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +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/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +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.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +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/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +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/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +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= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +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= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +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/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +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/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +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/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +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/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +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 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasthttp v1.17.0 h1:P8/koH4aSnJ4xbd0cUUFEGQs3jQqIxoDDyRQrUiAkqg= +github.com/valyala/fasthttp v1.17.0/go.mod h1:jjraHZVbKOXftJfsOYoAjaeygpj5hr8ermTRJNroD7A= +github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/vetcher/go-astra v1.2.0 h1:PimAuC1QDbkzw7tQ26JvTGqXbdeW7xVYfbj87YnXWXw= +github.com/vetcher/go-astra v1.2.0/go.mod h1:w+tZwvFo3O3gt4c/TGNVzVQZSlEykOJHt75yL/bLXUM= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +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/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +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-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= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +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-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-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-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201016165138-7b1cca2348c0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +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/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-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/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= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +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-20191024005414-555d28b269f0/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= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +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-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +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= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/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-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +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= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +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.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +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/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/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +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= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +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-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/tests/unmarshalling/httpclient/builder.go b/tests/unmarshalling/httpclient/builder.go new file mode 100644 index 0000000..c141980 --- /dev/null +++ b/tests/unmarshalling/httpclient/builder.go @@ -0,0 +1,49 @@ +// Package httpclient ... +// CODE GENERATED AUTOMATICALLY +// DO NOT EDIT +package httpclient + +import ( + "net/url" + + "github.com/pkg/errors" + "github.com/valyala/fasthttp" +) + +const ( + httpMethodTestEasyJson = "GET" + uriPathClientTestEasyJson = "/api/testeasyjson" +) + +type errorProcessor interface { + Decode(r *fasthttp.Response) error +} + +// New ... +func New( + serverURL string, + maxConns int, + errorProcessor errorProcessor, + options map[interface{}]Option, +) (client Service, err error) { + parsedServerURL, err := url.Parse(serverURL) + if err != nil { + err = errors.Wrap(err, "failed to parse server url") + return + } + transportTestEasyJson := NewTestEasyJsonTransport( + errorProcessor, + parsedServerURL.Scheme+"://"+parsedServerURL.Host+uriPathClientTestEasyJson, + httpMethodTestEasyJson, + ) + + client = NewClient( + &fasthttp.HostClient{ + Addr: parsedServerURL.Host, + MaxConns: maxConns, + }, + transportTestEasyJson, + options, + ) + return +} diff --git a/tests/unmarshalling/httpclient/builder_test.go b/tests/unmarshalling/httpclient/builder_test.go new file mode 100644 index 0000000..704fc05 --- /dev/null +++ b/tests/unmarshalling/httpclient/builder_test.go @@ -0,0 +1,71 @@ +// Package httpclient ... +// CODE GENERATED AUTOMATICALLY +// DO NOT EDIT +package httpclient + +import ( + "fmt" + "math/rand" + "net/url" + "reflect" + "testing" + "time" + + "github.com/valyala/fasthttp" +) + +type testErrorProcessor struct{} + +func TestNew(t *testing.T) { + serverURL := fmt.Sprintf("https://%v.com", time.Now().UnixNano()) + parsedServerURL, _ := url.Parse(serverURL) + maxConns := rand.Int() + opts := map[interface{}]Option{} + + transportTestEasyJson := NewTestEasyJsonTransport( + &testErrorProcessor{}, + parsedServerURL.Scheme+"://"+parsedServerURL.Host+uriPathClientTestEasyJson, + httpMethodTestEasyJson, + ) + + cl := client{ + &fasthttp.HostClient{ + Addr: parsedServerURL.Host, + MaxConns: maxConns, + }, + transportTestEasyJson, + opts, + } + + type args struct { + serverURL string + maxConns int + errorProcessor errorProcessor + options map[interface{}]Option + } + tests := []struct { + name string + args args + wantClient Service + wantErr bool + }{ + {"test new builder", args{serverURL, maxConns, &testErrorProcessor{}, opts}, &cl, false}, + {"test new builder incorrect URL", args{" http:example%20.com", maxConns, &testErrorProcessor{}, opts}, nil, true}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + gotClient, err := New(tt.args.serverURL, tt.args.maxConns, tt.args.errorProcessor, tt.args.options) + if (err != nil) != tt.wantErr { + t.Errorf("New() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotClient, tt.wantClient) { + t.Errorf("New() = %v, want %v", gotClient, tt.wantClient) + } + }) + } +} + +func (ep *testErrorProcessor) Decode(r *fasthttp.Response) error { + return nil +} diff --git a/tests/unmarshalling/httpclient/client.go b/tests/unmarshalling/httpclient/client.go new file mode 100644 index 0000000..60f220d --- /dev/null +++ b/tests/unmarshalling/httpclient/client.go @@ -0,0 +1,66 @@ +// Package httpclient ... +// CODE GENERATED AUTOMATICALLY +// DO NOT EDIT +package httpclient + +import ( + "context" + + "github.com/valyala/fasthttp" +) + +// Options ... +var ( + TestEasyJson = option{} +) + +type option struct{} + +// Option ... +type Option interface { + Prepare(ctx context.Context, r *fasthttp.Request) +} + +// Service ... +type Service interface { + TestEasyJson(ctx context.Context, param1 int) (field1 string, field2 string, err error) +} + +type client struct { + cli *fasthttp.HostClient + transportTestEasyJson TestEasyJsonTransport + options map[interface{}]Option +} + +// TestEasyJson ... +func (s *client) TestEasyJson(ctx context.Context, param1 int) (field1 string, field2 string, err error) { + req, res := fasthttp.AcquireRequest(), fasthttp.AcquireResponse() + defer func() { + fasthttp.ReleaseRequest(req) + fasthttp.ReleaseResponse(res) + }() + if opt, ok := s.options[TestEasyJson]; ok { + opt.Prepare(ctx, req) + } + if err = s.transportTestEasyJson.EncodeRequest(ctx, req, param1); err != nil { + return + } + err = s.cli.Do(req, res) + if err != nil { + return + } + return s.transportTestEasyJson.DecodeResponse(ctx, res) +} + +// NewClient the client creator +func NewClient( + cli *fasthttp.HostClient, + transportTestEasyJson TestEasyJsonTransport, + options map[interface{}]Option, +) Service { + return &client{ + cli: cli, + transportTestEasyJson: transportTestEasyJson, + options: options, + } +} diff --git a/tests/unmarshalling/httpclient/client_test.go b/tests/unmarshalling/httpclient/client_test.go new file mode 100644 index 0000000..41bad17 --- /dev/null +++ b/tests/unmarshalling/httpclient/client_test.go @@ -0,0 +1,163 @@ +// Package httpclient ... +// CODE GENERATED AUTOMATICALLY +// DO NOT EDIT +package httpclient + +import ( + "context" + "encoding/json" + "fmt" + "math/rand" + "net/http" + "net/http/httptest" + "net/url" + "reflect" + "testing" + "time" + + "github.com/bxcodec/faker/v3" + "github.com/valyala/fasthttp" +) + +func Test_client_TestEasyJson(t *testing.T) { + + var param1 int + _ = faker.FakeData(¶m1) + + var field1 string + _ = faker.FakeData(&field1) + + var field2 string + _ = faker.FakeData(&field2) + + maxConns := rand.Int() + 1 + opts := map[interface{}]Option{} + + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + + result := struct { + Field1 string `json:"field1"` + + Field2 string `json:"field2"` + }{ + + Field1: field1, + + Field2: field2, + } + + b, _ := json.Marshal(result) + w.Write(b) + })) + defer ts.Close() + + parsedServerURL, _ := url.Parse(ts.URL) + + hostClient := &fasthttp.HostClient{ + Addr: parsedServerURL.Host, + MaxConns: maxConns, + } + + transportTestEasyJson := NewTestEasyJsonTransport( + &testErrorProcessor{}, + parsedServerURL.Scheme+"://"+parsedServerURL.Host+uriPathClientTestEasyJson, + httpMethodTestEasyJson, + ) + + type fields struct { + cli *fasthttp.HostClient + transportTestEasyJson TestEasyJsonTransport + options map[interface{}]Option + } + type args struct { + ctx context.Context + param1 int + } + tests := []struct { + name string + fields fields + args args + + wantField1 string + + wantField2 string + + wantErr bool + }{ + { + "test TestEasyJson", + fields{hostClient, transportTestEasyJson, opts}, + args{context.Background(), param1}, + field1, + field2, + + false}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + s := &client{ + cli: tt.fields.cli, + transportTestEasyJson: tt.fields.transportTestEasyJson, + options: tt.fields.options, + } + gotField1, gotField2, err := s.TestEasyJson(tt.args.ctx, tt.args.param1) + if (err != nil) != tt.wantErr { + t.Errorf("client.TestEasyJson() error = %v, wantErr %v", err, tt.wantErr) + return + } + + if !reflect.DeepEqual(gotField1, tt.wantField1) { + t.Errorf("client.field1() = %v, want %v", gotField1, tt.wantField1) + } + + if !reflect.DeepEqual(gotField2, tt.wantField2) { + t.Errorf("client.field2() = %v, want %v", gotField2, tt.wantField2) + } + + }) + } +} + +func TestNewClient(t *testing.T) { + serverURL := fmt.Sprintf("https://%v.com", time.Now().UnixNano()) + parsedServerURL, _ := url.Parse(serverURL) + hostClient := &fasthttp.HostClient{ + Addr: parsedServerURL.Host, + MaxConns: rand.Int(), + } + opts := map[interface{}]Option{} + + transportTestEasyJson := NewTestEasyJsonTransport( + &testErrorProcessor{}, + parsedServerURL.Scheme+"://"+parsedServerURL.Host+uriPathClientTestEasyJson, + httpMethodTestEasyJson, + ) + + cl := &client{ + hostClient, + transportTestEasyJson, + opts, + } + + type args struct { + cli *fasthttp.HostClient + + transportTestEasyJson TestEasyJsonTransport + + options map[interface{}]Option + } + tests := []struct { + name string + args args + want Service + }{ + {"test new client", args{hostClient, transportTestEasyJson, opts}, cl}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := NewClient(tt.args.cli, tt.args.transportTestEasyJson, tt.args.options); !reflect.DeepEqual(got, tt.want) { + t.Errorf("NewClient() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/tests/unmarshalling/httpclient/transport.go b/tests/unmarshalling/httpclient/transport.go new file mode 100644 index 0000000..2c5ae55 --- /dev/null +++ b/tests/unmarshalling/httpclient/transport.go @@ -0,0 +1,79 @@ +// Package httpclient ... +// CODE GENERATED AUTOMATICALLY +// DO NOT EDIT +package httpclient + +import ( + "context" + "net/http" + "strconv" + + "github.com/valyala/fasthttp" +) + +//easyjson:json +type testEasyJsonResponse struct { + Field1 string `json:"field1"` + Field2 string `json:"field2"` +} + +// TestEasyJsonTransport transport interface +type TestEasyJsonTransport interface { + EncodeRequest(ctx context.Context, r *fasthttp.Request, param1 int) (err error) + DecodeResponse(ctx context.Context, r *fasthttp.Response) (field1 string, field2 string, err error) +} + +type testEasyJsonTransport struct { + errorProcessor errorProcessor + pathTemplate string + method string +} + +// EncodeRequest method for decoding requests on server side +func (t *testEasyJsonTransport) EncodeRequest(ctx context.Context, r *fasthttp.Request, param1 int) (err error) { + r.Header.SetMethod(t.method) + r.SetRequestURI(t.pathTemplate) + + r.URI().QueryArgs().Set("param1", strconv.Itoa(param1)) + + r.Header.Set("Content-Type", "application/json") + + return +} + +// DecodeResponse method for encoding response on server side +func (t *testEasyJsonTransport) DecodeResponse(ctx context.Context, r *fasthttp.Response) (field1 string, field2 string, err error) { + if r.StatusCode() != http.StatusOK { + err = t.errorProcessor.Decode(r) + return + } + + var theResponse testEasyJsonResponse + if err = theResponse.UnmarshalJSON(r.Body()); err != nil { + return + } + + field1 = theResponse.Field1 + + field2 = theResponse.Field2 + + return +} + +// NewTestEasyJsonTransport the transport creator for http requests +func NewTestEasyJsonTransport( + errorProcessor errorProcessor, + pathTemplate string, + method string, +) TestEasyJsonTransport { + return &testEasyJsonTransport{ + errorProcessor: errorProcessor, + pathTemplate: pathTemplate, + method: method, + } +} + +func ptr(in []byte) *string { + i := string(in) + return &i +} diff --git a/tests/unmarshalling/httpclient/transport_easyjson.go b/tests/unmarshalling/httpclient/transport_easyjson.go new file mode 100644 index 0000000..0c08d8e --- /dev/null +++ b/tests/unmarshalling/httpclient/transport_easyjson.go @@ -0,0 +1,151 @@ +// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. + +package httpclient + +import ( + json "encoding/json" + easyjson "github.com/mailru/easyjson" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" +) + +// suppress unused package warning +var ( + _ *json.RawMessage + _ *jlexer.Lexer + _ *jwriter.Writer + _ easyjson.Marshaler +) + +func easyjsonC87d08bdDecodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpclient(in *jlexer.Lexer, out *testEasyJsonTransport) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonC87d08bdEncodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpclient(out *jwriter.Writer, in testEasyJsonTransport) { + out.RawByte('{') + first := true + _ = first + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v testEasyJsonTransport) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonC87d08bdEncodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpclient(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v testEasyJsonTransport) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonC87d08bdEncodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpclient(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *testEasyJsonTransport) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonC87d08bdDecodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpclient(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *testEasyJsonTransport) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonC87d08bdDecodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpclient(l, v) +} +func easyjsonC87d08bdDecodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpclient1(in *jlexer.Lexer, out *testEasyJsonResponse) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "field1": + out.Field1 = string(in.String()) + case "field2": + out.Field2 = string(in.String()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonC87d08bdEncodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpclient1(out *jwriter.Writer, in testEasyJsonResponse) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"field1\":" + out.RawString(prefix[1:]) + out.String(string(in.Field1)) + } + { + const prefix string = ",\"field2\":" + out.RawString(prefix) + out.String(string(in.Field2)) + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v testEasyJsonResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonC87d08bdEncodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpclient1(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v testEasyJsonResponse) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonC87d08bdEncodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpclient1(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *testEasyJsonResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonC87d08bdDecodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpclient1(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *testEasyJsonResponse) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonC87d08bdDecodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpclient1(l, v) +} diff --git a/tests/unmarshalling/httperrors/client.go b/tests/unmarshalling/httperrors/client.go new file mode 100644 index 0000000..f2689c3 --- /dev/null +++ b/tests/unmarshalling/httperrors/client.go @@ -0,0 +1,54 @@ +// Package httperrors ... +// CODE GENERATED AUTOMATICALLY +// DO NOT EDIT +package httperrors + +import ( + "context" + "net/http" + "strings" + + "github.com/valyala/fasthttp" +) + +// ClientErrorProcessor ... +type ClientErrorProcessor struct { + defaultCode int + defaultMessage string +} + +// Encode writes a svc error to the given http.ResponseWriter. +func (e *ClientErrorProcessor) Encode(ctx context.Context, r *fasthttp.Response, err error) { + code := e.defaultCode + message := e.defaultMessage + if err, ok := err.(*httpError); ok { + if err.Code != e.defaultCode { + code = err.Code + message = err.Message + } + } + r.SetStatusCode(code) + r.SetBodyString(message) + return +} + +// Decode reads a Service error from the given *http.Response. +func (e *ClientErrorProcessor) Decode(r *fasthttp.Response) error { + msgBytes := r.Body() + msg := strings.TrimSpace(string(msgBytes)) + if msg == "" { + msg = http.StatusText(r.StatusCode()) + } + return &httpError{ + Code: r.StatusCode(), + Message: msg, + } +} + +// NewClientErrorProcessor ... +func NewClientErrorProcessor(defaultCode int, defaultMessage string) *ClientErrorProcessor { + return &ClientErrorProcessor{ + defaultCode: defaultCode, + defaultMessage: defaultMessage, + } +} diff --git a/tests/unmarshalling/httperrors/ui.go b/tests/unmarshalling/httperrors/ui.go new file mode 100644 index 0000000..4f67a42 --- /dev/null +++ b/tests/unmarshalling/httperrors/ui.go @@ -0,0 +1,82 @@ +// Package httperrors ... +// CODE GENERATED AUTOMATICALLY +// DO NOT EDIT +package httperrors + +import ( + "context" + "encoding/json" + "net/http" + "strings" + + "github.com/valyala/fasthttp" +) + +type httpError struct { + Code int + Message string +} + +// Error returns a text message corresponding to the given error. +func (e *httpError) Error() string { + return e.Message +} + +// StatusCode returns an HTTP status code corresponding to the given error. +func (e *httpError) StatusCode() int { + return e.Code +} + +type errorResponse struct { + Error bool `json:"error"` + ErrorText string `json:"errorText"` + AdditionalErrors map[string]string `json:"additionalErrors"` + Data *struct{} `json:"data"` +} + +// ErrorProcessor ... +type ErrorProcessor struct { + errors map[string]string +} + +//Encode writes a svc error to the given http.ResponseWriter. +func (e *ErrorProcessor) Encode(ctx context.Context, r *fasthttp.Response, err error) { + errorText := err.Error() + if idx := strings.Index(err.Error(), ":"); idx != -1 { + numberOfError := err.Error()[:idx] + if text, ok := e.errors[numberOfError]; ok { + errorText = text + } + } + res := errorResponse{ + Error: true, + ErrorText: errorText, + } + r.SetStatusCode(200) + r.Header.Set("Content-Type", "application/json") + body, err := json.Marshal(res) + if err != nil { + return + } + r.SetBody(body) +} + +// Decode reads a Service error from the given *http.Response. +func (e *ErrorProcessor) Decode(r *fasthttp.Response) error { + msgBytes := r.Body() + msg := strings.TrimSpace(string(msgBytes)) + if msg == "" { + msg = http.StatusText(r.StatusCode()) + } + return &httpError{ + Code: r.StatusCode(), + Message: msg, + } +} + +// NewErrorProcessor ... +func NewErrorProcessor(errors map[string]string) *ErrorProcessor { + return &ErrorProcessor{ + errors: errors, + } +} diff --git a/tests/unmarshalling/httpserver/builder.go b/tests/unmarshalling/httpserver/builder.go new file mode 100644 index 0000000..7c66f61 --- /dev/null +++ b/tests/unmarshalling/httpserver/builder.go @@ -0,0 +1,38 @@ +// Package httpserver ... +// CODE GENERATED AUTOMATICALLY +// DO NOT EDIT +package httpserver + +import ( + "context" + "net/http/pprof" + + "github.com/buaazp/fasthttprouter" + "github.com/valyala/fasthttp" + "github.com/valyala/fasthttp/fasthttpadaptor" +) + +const ( + httpMethodTestEasyJson = "GET" + uriPathTestEasyJson = "/api/testeasyjson" +) + +type errorProcessor interface { + Encode(ctx context.Context, r *fasthttp.Response, err error) +} + +type errorCreator func(err error) error + +// New ... +func New(router *fasthttprouter.Router, svc service, decodeJSONErrorCreator errorCreator, encodeJSONErrorCreator errorCreator, decodeTypeIntErrorCreator errorCreator, errorProcessor errorProcessor) { + + testEasyJsonTransport := NewTestEasyJsonTransport( + + encodeJSONErrorCreator, + decodeTypeIntErrorCreator, + ) + router.Handle(httpMethodTestEasyJson, uriPathTestEasyJson, NewTestEasyJson(testEasyJsonTransport, svc, errorProcessor)) + + router.Handle("GET", "/debug/pprof/", fasthttpadaptor.NewFastHTTPHandlerFunc(pprof.Index)) + router.Handle("GET", "/debug/pprof/profile", fasthttpadaptor.NewFastHTTPHandlerFunc(pprof.Profile)) +} diff --git a/tests/unmarshalling/httpserver/server.go b/tests/unmarshalling/httpserver/server.go new file mode 100644 index 0000000..84251d5 --- /dev/null +++ b/tests/unmarshalling/httpserver/server.go @@ -0,0 +1,56 @@ +// Package httpserver ... +// CODE GENERATED AUTOMATICALLY +// DO NOT EDIT +package httpserver + +import ( + "context" + + "github.com/valyala/fasthttp" +) + +type service interface { + TestEasyJson(ctx context.Context, param1 int) (field1 string, field2 string, err error) +} + +type testEasyJson struct { + transport TestEasyJsonTransport + service service + errorProcessor errorProcessor +} + +// ServeHTTP implements http.Handler. +func (s *testEasyJson) ServeHTTP(ctx *fasthttp.RequestCtx) { + var ( + param1 int + field1 string + field2 string + err error + ) + param1, err = s.transport.DecodeRequest(ctx, &ctx.Request) + if err != nil { + s.errorProcessor.Encode(ctx, &ctx.Response, err) + return + } + + field1, field2, err = s.service.TestEasyJson(ctx, param1) + if err != nil { + s.errorProcessor.Encode(ctx, &ctx.Response, err) + return + } + + if err = s.transport.EncodeResponse(ctx, &ctx.Response, field1, field2); err != nil { + s.errorProcessor.Encode(ctx, &ctx.Response, err) + return + } +} + +// NewTestEasyJson the server creator +func NewTestEasyJson(transport TestEasyJsonTransport, service service, errorProcessor errorProcessor) fasthttp.RequestHandler { + ls := testEasyJson{ + transport: transport, + service: service, + errorProcessor: errorProcessor, + } + return ls.ServeHTTP +} diff --git a/tests/unmarshalling/httpserver/transport.go b/tests/unmarshalling/httpserver/transport.go new file mode 100644 index 0000000..b41d793 --- /dev/null +++ b/tests/unmarshalling/httpserver/transport.go @@ -0,0 +1,97 @@ +// Package httpserver ... +// CODE GENERATED AUTOMATICALLY +// DO NOT EDIT +package httpserver + +import ( + "bytes" + "net/http" + "strconv" + + "github.com/valyala/fasthttp" +) + +var ( + emptyBytes = []byte("") +) + +//easyjson:json +type testEasyJsonResponse struct { + Field1 string `json:"field1"` + + Field2 string `json:"field2"` +} + +// TestEasyJsonTransport transport interface +type TestEasyJsonTransport interface { + DecodeRequest(ctx *fasthttp.RequestCtx, r *fasthttp.Request) (param1 int, err error) + EncodeResponse(ctx *fasthttp.RequestCtx, r *fasthttp.Response, field1 string, field2 string) (err error) +} + +type testEasyJsonTransport struct { + encodeJSONErrorCreator errorCreator + decodeTypeIntErrorCreator errorCreator +} + +// DecodeRequest method for decoding requests on server side +func (t *testEasyJsonTransport) DecodeRequest(ctx *fasthttp.RequestCtx, r *fasthttp.Request) (param1 int, err error) { + + _param1 := ctx.QueryArgs().Peek("param1") + if !bytes.Equal(_param1, emptyBytes) { + var i int + i, err = strconv.Atoi(string(_param1)) + if err != nil { + err = t.decodeTypeIntErrorCreator(err) + return + } + + param1 = i + + } + + return +} + +// EncodeResponse method for encoding response on server side +func (t *testEasyJsonTransport) EncodeResponse(ctx *fasthttp.RequestCtx, r *fasthttp.Response, field1 string, field2 string) (err error) { + + r.Header.Set("Content-Type", "application/json") + var theResponse testEasyJsonResponse + + theResponse.Field1 = field1 + + theResponse.Field2 = field2 + + body, err := theResponse.MarshalJSON() + if err != nil { + err = t.encodeJSONErrorCreator(err) + return + } + r.SetBody(body) + + r.Header.SetStatusCode(http.StatusOK) + return +} + +// NewTestEasyJsonTransport the transport creator for http requests +func NewTestEasyJsonTransport( + + encodeJSONErrorCreator errorCreator, + + decodeTypeIntErrorCreator errorCreator, +) TestEasyJsonTransport { + return &testEasyJsonTransport{ + + encodeJSONErrorCreator: encodeJSONErrorCreator, + + decodeTypeIntErrorCreator: decodeTypeIntErrorCreator, + } +} + +func ptr(in []byte) *string { + if bytes.Equal(in, emptyBytes) { + return nil + } + i := string(in) + return &i +} diff --git a/tests/unmarshalling/httpserver/transport_easyjson.go b/tests/unmarshalling/httpserver/transport_easyjson.go new file mode 100644 index 0000000..3edba1d --- /dev/null +++ b/tests/unmarshalling/httpserver/transport_easyjson.go @@ -0,0 +1,151 @@ +// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. + +package httpserver + +import ( + json "encoding/json" + easyjson "github.com/mailru/easyjson" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" +) + +// suppress unused package warning +var ( + _ *json.RawMessage + _ *jlexer.Lexer + _ *jwriter.Writer + _ easyjson.Marshaler +) + +func easyjsonC87d08bdDecodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpserver(in *jlexer.Lexer, out *testEasyJsonTransport) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonC87d08bdEncodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpserver(out *jwriter.Writer, in testEasyJsonTransport) { + out.RawByte('{') + first := true + _ = first + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v testEasyJsonTransport) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonC87d08bdEncodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpserver(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v testEasyJsonTransport) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonC87d08bdEncodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpserver(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *testEasyJsonTransport) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonC87d08bdDecodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpserver(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *testEasyJsonTransport) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonC87d08bdDecodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpserver(l, v) +} +func easyjsonC87d08bdDecodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpserver1(in *jlexer.Lexer, out *testEasyJsonResponse) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "field1": + out.Field1 = string(in.String()) + case "field2": + out.Field2 = string(in.String()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonC87d08bdEncodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpserver1(out *jwriter.Writer, in testEasyJsonResponse) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"field1\":" + out.RawString(prefix[1:]) + out.String(string(in.Field1)) + } + { + const prefix string = ",\"field2\":" + out.RawString(prefix) + out.String(string(in.Field2)) + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v testEasyJsonResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonC87d08bdEncodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpserver1(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v testEasyJsonResponse) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonC87d08bdEncodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpserver1(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *testEasyJsonResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonC87d08bdDecodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpserver1(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *testEasyJsonResponse) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonC87d08bdDecodeGithubComWildberriesRuGoTransportGeneratorTestUnmarshallingHttpserver1(l, v) +} diff --git a/tests/unmarshalling/service.go b/tests/unmarshalling/service.go new file mode 100644 index 0000000..2b927bb --- /dev/null +++ b/tests/unmarshalling/service.go @@ -0,0 +1,48 @@ +package unmarshalling + +import ( + "context" + "github.com/prometheus/common/log" +) + +// @gtg http-server http-client http-errors +type Service interface { + // @gtg http-server-method GET + // @gtg http-server-uri-path /api/testeasyjson + // @gtg http-server-query param1={param1} + // @gtg http-server-response-json-tag field1 field1 + // @gtg http-server-response-json-tag field2 field2 + // @gtg http-server-content-type application/json + // @gtg http-server-response-status http.StatusOK + // @gtg http-server-response-content-type application/json + TestEasyJson(ctx context.Context, param1 int) (field1 , field2 string, err error) +} + +type TestService struct { + +} + +const FieldValue1 = "hello \"world" +const FieldValue2 = "test" + +func (s *TestService ) TestEasyJson(ctx context.Context, param1 int) (field1 , field2 string, err error){ + + switch param1 { + case 0: + field1 = FieldValue1 + field2 = FieldValue2 + case 1: + field1 = FieldValue2 + field2 = FieldValue1 + default: + log.Errorf("unknown param value: %v", param1) + } + + return +} + +func NewService() *TestService { + + return &TestService{} + +} \ No newline at end of file diff --git a/tests/unmarshalling/service_test.go b/tests/unmarshalling/service_test.go new file mode 100644 index 0000000..c786ff9 --- /dev/null +++ b/tests/unmarshalling/service_test.go @@ -0,0 +1,88 @@ +package unmarshalling + +import ( + "context" + "github.com/buaazp/fasthttprouter" + "github.com/stretchr/testify/assert" + "github.com/valyala/fasthttp" + "github.com/wildberries-ru/go-transport-generator/tests/unmarshalling/httpclient" + "github.com/wildberries-ru/go-transport-generator/tests/unmarshalling/httpserver" + "sync" + "testing" + "time" +) + +func TestEasyJson(t *testing.T) { + + svc := NewService() + + router := fasthttprouter.New() + httpserver.New(router, svc, nil, nil, nil, nil) + + fasthttpServer := &fasthttp.Server{ + Handler: router.Handler, + } + + stop := make(chan struct {}) + poll := make(chan struct {}, 100) + var wg sync.WaitGroup + + wg.Add(1) + go func() { + defer wg.Done() + if err := fasthttpServer.ListenAndServe(":8080" ); err != nil { + t.Fatalf("%v", err) + } + }() + + time.Sleep(1 * time.Second) + + wg.Add(1) + go func() { + defer wg.Done() + <- stop + _ = fasthttpServer.Shutdown() + t.Log("fasthttpServer stopped") + }() + + client, err := httpclient.New("http://localhost:8080", 100,nil,map[interface{}]httpclient.Option{}) + assert.Nilf(t,err, "failed to create client") + var wg2 sync.WaitGroup + + var result []struct { + val1 string + val2 string + } + + for i := 0; i < 100; i++ { + wg2.Add(1) + go func(val int) { + poll <- struct{}{} + defer wg2.Done() + field1 , field2 , err := client.TestEasyJson(context.Background(), val %2) + <- poll + assert.Nilf(t,err, "failed to create client") + result = append(result, struct { + val1 string + val2 string + }{val1:field1 , val2: field2}) + + }(i) + } + wg2.Wait() + + for _, val := range result { + if val.val1 != FieldValue1 && val.val1 != FieldValue2 { + assert.FailNowf(t, "field1 has wrong value", "%v is not expected", val.val1) + } + if val.val2 != FieldValue1 && val.val2 != FieldValue2 { + assert.FailNowf(t, "field2 has wrong value", "%v is not expected", val.val2) + } + } + + + stop <- struct{}{} + wg.Done() + t.Log("done") +} + From cfd6d100905d63b4f11afbca6131bf3be690e682 Mon Sep 17 00:00:00 2001 From: Sergei Sobolev Date: Tue, 17 Nov 2020 16:45:39 +0300 Subject: [PATCH 2/4] fix error message --- tests/unmarshalling/service_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unmarshalling/service_test.go b/tests/unmarshalling/service_test.go index c786ff9..c0254d0 100644 --- a/tests/unmarshalling/service_test.go +++ b/tests/unmarshalling/service_test.go @@ -61,7 +61,7 @@ func TestEasyJson(t *testing.T) { defer wg2.Done() field1 , field2 , err := client.TestEasyJson(context.Background(), val %2) <- poll - assert.Nilf(t,err, "failed to create client") + assert.Nilf(t,err, "TestEasyJson failed") result = append(result, struct { val1 string val2 string From 7cd1e657f4e1a6048c207527315df5a57cd96fb4 Mon Sep 17 00:00:00 2001 From: Sergei Sobolev Date: Tue, 17 Nov 2020 16:50:56 +0300 Subject: [PATCH 3/4] del goroutines --- tests/unmarshalling/service_test.go | 42 +++++++++++------------------ 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/tests/unmarshalling/service_test.go b/tests/unmarshalling/service_test.go index c0254d0..afbd161 100644 --- a/tests/unmarshalling/service_test.go +++ b/tests/unmarshalling/service_test.go @@ -2,14 +2,14 @@ package unmarshalling import ( "context" + "sync" + "testing" + "github.com/buaazp/fasthttprouter" "github.com/stretchr/testify/assert" "github.com/valyala/fasthttp" "github.com/wildberries-ru/go-transport-generator/tests/unmarshalling/httpclient" "github.com/wildberries-ru/go-transport-generator/tests/unmarshalling/httpserver" - "sync" - "testing" - "time" ) func TestEasyJson(t *testing.T) { @@ -23,30 +23,27 @@ func TestEasyJson(t *testing.T) { Handler: router.Handler, } - stop := make(chan struct {}) - poll := make(chan struct {}, 100) + stop := make(chan struct{}) var wg sync.WaitGroup wg.Add(1) go func() { defer wg.Done() - if err := fasthttpServer.ListenAndServe(":8080" ); err != nil { + if err := fasthttpServer.ListenAndServe(":8080"); err != nil { t.Fatalf("%v", err) } }() - time.Sleep(1 * time.Second) - wg.Add(1) go func() { defer wg.Done() - <- stop + <-stop _ = fasthttpServer.Shutdown() t.Log("fasthttpServer stopped") }() - client, err := httpclient.New("http://localhost:8080", 100,nil,map[interface{}]httpclient.Option{}) - assert.Nilf(t,err, "failed to create client") + client, err := httpclient.New("http://localhost:8080", 100, nil, map[interface{}]httpclient.Option{}) + assert.Nilf(t, err, "failed to create client") var wg2 sync.WaitGroup var result []struct { @@ -54,20 +51,13 @@ func TestEasyJson(t *testing.T) { val2 string } - for i := 0; i < 100; i++ { - wg2.Add(1) - go func(val int) { - poll <- struct{}{} - defer wg2.Done() - field1 , field2 , err := client.TestEasyJson(context.Background(), val %2) - <- poll - assert.Nilf(t,err, "TestEasyJson failed") - result = append(result, struct { - val1 string - val2 string - }{val1:field1 , val2: field2}) - - }(i) + for i := 0; i < 10; i++ { + field1, field2, err := client.TestEasyJson(context.Background(), i%2) + assert.Nilf(t, err, "TestEasyJson failed") + result = append(result, struct { + val1 string + val2 string + }{val1: field1, val2: field2}) } wg2.Wait() @@ -80,9 +70,7 @@ func TestEasyJson(t *testing.T) { } } - stop <- struct{}{} wg.Done() t.Log("done") } - From c0955e8a0d6a1c57c9b9c137860f2068f8ebd357 Mon Sep 17 00:00:00 2001 From: Sergei Sobolev Date: Wed, 18 Nov 2020 01:35:47 +0300 Subject: [PATCH 4/4] del wg --- tests/unmarshalling/service_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/unmarshalling/service_test.go b/tests/unmarshalling/service_test.go index afbd161..30c2d01 100644 --- a/tests/unmarshalling/service_test.go +++ b/tests/unmarshalling/service_test.go @@ -44,7 +44,6 @@ func TestEasyJson(t *testing.T) { client, err := httpclient.New("http://localhost:8080", 100, nil, map[interface{}]httpclient.Option{}) assert.Nilf(t, err, "failed to create client") - var wg2 sync.WaitGroup var result []struct { val1 string @@ -59,7 +58,6 @@ func TestEasyJson(t *testing.T) { val2 string }{val1: field1, val2: field2}) } - wg2.Wait() for _, val := range result { if val.val1 != FieldValue1 && val.val1 != FieldValue2 {