From f3b7043d5a420b5cb7ba7e64ced4562f040617e6 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 3 Nov 2021 18:05:16 +0300 Subject: [PATCH 1/4] add meter tests Signed-off-by: Vasiliy Tolstov --- go.mod | 3 +- go.sum | 37 +++- meter/prometheus/prometheus_test.go | 40 +++++ meter/victoriametrics/victoriametrics_test.go | 40 +++++ .../victoriametrics/victoriametrics_test.go | 158 ------------------ 5 files changed, 118 insertions(+), 160 deletions(-) create mode 100644 meter/prometheus/prometheus_test.go create mode 100644 meter/victoriametrics/victoriametrics_test.go delete mode 100644 metric/victoriametrics/victoriametrics_test.go diff --git a/go.mod b/go.mod index a1ab1e6..2ede4bf 100644 --- a/go.mod +++ b/go.mod @@ -24,6 +24,7 @@ require ( go.unistack.org/micro-config-consul/v3 v3.8.0 go.unistack.org/micro-config-env/v3 v3.8.1 go.unistack.org/micro-config-vault/v3 v3.8.1 + go.unistack.org/micro-meter-prometheus/v3 v3.8.0 go.unistack.org/micro-meter-victoriametrics/v3 v3.8.2 go.unistack.org/micro-proto/v3 v3.1.0 go.unistack.org/micro-router-register/v3 v3.8.1 @@ -33,7 +34,7 @@ require ( go.unistack.org/micro-wrapper-recovery/v3 v3.8.0 go.unistack.org/micro-wrapper-sql/v3 v3.0.1 go.unistack.org/micro-wrapper-trace-opentracing/v3 v3.8.0 - go.unistack.org/micro/v3 v3.8.6 + go.unistack.org/micro/v3 v3.8.7 google.golang.org/grpc v1.41.0 google.golang.org/protobuf v1.27.1 modernc.org/sqlite v1.13.3 diff --git a/go.sum b/go.sum index e9bef1d..c5207c2 100644 --- a/go.sum +++ b/go.sum @@ -13,6 +13,7 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy 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/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= 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= @@ -26,13 +27,16 @@ github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpi github.com/aws/aws-sdk-go v1.30.27/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= 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/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/cenkalti/backoff/v3 v3.2.2 h1:cfUAAO3yvKMYKPrvhDuHSwQnhZNk/RMHKdZqKTxfm6M= github.com/cenkalti/backoff/v3 v3.2.2/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= 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/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= @@ -86,10 +90,12 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= 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/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-ldap/ldap/v3 v3.1.3/go.mod h1:3rbOH3jRS2u6jg2rJnKAMLE/xQyCKIveG2Sa/Cohzb8= github.com/go-ldap/ldap/v3 v3.1.10/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q= 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/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -223,9 +229,13 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmoiron/sqlx v1.3.4 h1:wv+0IJZfL5z0uZoUjlpKgHkgaFSYD+r9CfrXjEXsO7w= github.com/jmoiron/sqlx v1.3.4/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 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/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -238,6 +248,7 @@ github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47e github.com/klauspost/cpuid/v2 v2.0.6 h1:dQ5ueTiftKxp0gyjKSx5+8BtPWkyQbd95m8Gys/RarI= github.com/klauspost/cpuid/v2 v2.0.6/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= 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.3/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/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -265,6 +276,7 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.8 h1:gDp86IdQsN/xWjIEmr9MF6o9mpksUgh0fu+9ByFxzIU= github.com/mattn/go-sqlite3 v1.14.8/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +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/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26 h1:gPxPSwALAeHJSjarOs00QjVdV9QoBvc1D2ujQUr5BzU= @@ -291,6 +303,7 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= 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/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -329,18 +342,28 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= 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.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/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.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= 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.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/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/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -362,6 +385,7 @@ github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvH 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/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -432,6 +456,8 @@ go.unistack.org/micro-config-env/v3 v3.8.1 h1:OR/ZB4FWgXHy45jXrh8a3T3j9tmFNs6KGP go.unistack.org/micro-config-env/v3 v3.8.1/go.mod h1:Ef2j0gnQO9+T/AG1d2nkDndoRO9jJgQ4iECu8r/yYvs= go.unistack.org/micro-config-vault/v3 v3.8.1 h1:AtM1s4x5VxVgWhY6BAoHmNqmJ1Q580fenmC8YgQCaHM= go.unistack.org/micro-config-vault/v3 v3.8.1/go.mod h1:eUe4R19VFicFH3aSV8lGapub+/LTnk9O15EWx66vztE= +go.unistack.org/micro-meter-prometheus/v3 v3.8.0 h1:EcpINL+/3sPwIV+b+5jMfsjfkaNaf7UIdGycfkGGd9A= +go.unistack.org/micro-meter-prometheus/v3 v3.8.0/go.mod h1:fXuDyvHTS/zYqLBJ8bjW2owt3z6kwD1bqGxiJqMMtLU= go.unistack.org/micro-meter-victoriametrics/v3 v3.8.2 h1:1UgzebgfAxKekrv+/W/n9CJs6rzzLtLcmpS3fSRN1ac= go.unistack.org/micro-meter-victoriametrics/v3 v3.8.2/go.mod h1:qGYO+fCZvqLsDXCIWPMQscaR9uV+srIivq+L9O519nA= go.unistack.org/micro-proto/v3 v3.1.0 h1:q39FwjFiRZn+Ux/tt+d3bJTmDtsQQWa+3SLYVo1vLfA= @@ -454,8 +480,9 @@ go.unistack.org/micro/v3 v3.8.0/go.mod h1:Tkteri0wiiybbH6aPqay26pZHFIAwL9LXJc2x1 go.unistack.org/micro/v3 v3.8.2/go.mod h1:Tkteri0wiiybbH6aPqay26pZHFIAwL9LXJc2x1Jkakk= go.unistack.org/micro/v3 v3.8.4/go.mod h1:KMMmOmbgo/D52/rCAbqeKbBsgEEbSKM69he54J3ZIuA= go.unistack.org/micro/v3 v3.8.5/go.mod h1:KMMmOmbgo/D52/rCAbqeKbBsgEEbSKM69he54J3ZIuA= -go.unistack.org/micro/v3 v3.8.6 h1:nU6dpNRF7iF8dtcTTfzdPan8RkhiDuTsfMrXBmpzG/g= go.unistack.org/micro/v3 v3.8.6/go.mod h1:KMMmOmbgo/D52/rCAbqeKbBsgEEbSKM69he54J3ZIuA= +go.unistack.org/micro/v3 v3.8.7 h1:k1zOpJ3uS8MxdhK8annRsa5J/LW7MpqPjwYuekW61wE= +go.unistack.org/micro/v3 v3.8.7/go.mod h1:KMMmOmbgo/D52/rCAbqeKbBsgEEbSKM69he54J3ZIuA= golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/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= @@ -499,6 +526,7 @@ golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/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-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/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -508,6 +536,7 @@ golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211020060615-d418f374d309 h1:A0lJIi+hcTR6aajJH4YqKWwohY4aW9RO7oRMcdv+HKI= golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 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-20200107190931-bf48bf16ab8d/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= @@ -516,6 +545,7 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -537,18 +567,23 @@ golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/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-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/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-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/meter/prometheus/prometheus_test.go b/meter/prometheus/prometheus_test.go new file mode 100644 index 0000000..5ea2e32 --- /dev/null +++ b/meter/prometheus/prometheus_test.go @@ -0,0 +1,40 @@ +package prometheus_test + +import ( + "bytes" + "context" + "testing" + + "go.unistack.org/micro/v3/client" + "go.unistack.org/micro/v3/codec" + "go.unistack.org/micro/v3/meter" + "go.unistack.org/micro/v3/meter/wrapper" + prometheus "go.unistack.org/micro-meter-prometheus/v3" +) + +func TestWrapper(t *testing.T) { + m := prometheus.NewMeter() // meter.Labels("test_key", "test_val")) + + w := wrapper.NewClientWrapper( + wrapper.ServiceName("svc1"), + wrapper.ServiceVersion("0.0.1"), + wrapper.ServiceID("12345"), + wrapper.Meter(m), + ) + + ctx := context.Background() + + c := client.NewClient(client.Wrap(w)) + if err := c.Init(); err != nil { + t.Fatal(err) + } + rsp := &codec.Frame{} + req := &codec.Frame{} + err := c.Call(ctx, c.NewRequest("svc2", "Service.Method", req), rsp) + _, _ = rsp, err + buf := bytes.NewBuffer(nil) + _ = m.Write(buf, meter.WriteProcessMetrics(false), meter.WriteFDMetrics(false)) + if !bytes.Contains(buf.Bytes(), []byte(`micro_client_request_inflight{micro_endpoint="svc2.Service.Method"} 0`)) { + t.Fatalf("invalid metrics output: %s", buf.Bytes()) + } +} diff --git a/meter/victoriametrics/victoriametrics_test.go b/meter/victoriametrics/victoriametrics_test.go new file mode 100644 index 0000000..0608c9f --- /dev/null +++ b/meter/victoriametrics/victoriametrics_test.go @@ -0,0 +1,40 @@ +package victoriametrics_test + +import ( + "bytes" + "context" + "testing" + + "go.unistack.org/micro/v3/client" + "go.unistack.org/micro/v3/codec" + "go.unistack.org/micro/v3/meter" + "go.unistack.org/micro/v3/meter/wrapper" + victoriametrics "go.unistack.org/micro-meter-victoriametrics/v3" +) + +func TestWrapper(t *testing.T) { + m := victoriametrics.NewMeter() // meter.Labels("test_key", "test_val")) + + w := wrapper.NewClientWrapper( + wrapper.ServiceName("svc1"), + wrapper.ServiceVersion("0.0.1"), + wrapper.ServiceID("12345"), + wrapper.Meter(m), + ) + + ctx := context.Background() + + c := client.NewClient(client.Wrap(w)) + if err := c.Init(); err != nil { + t.Fatal(err) + } + rsp := &codec.Frame{} + req := &codec.Frame{} + err := c.Call(ctx, c.NewRequest("svc2", "Service.Method", req), rsp) + _, _ = rsp, err + buf := bytes.NewBuffer(nil) + _ = m.Write(buf, meter.WriteProcessMetrics(false), meter.WriteFDMetrics(false)) + if !bytes.Contains(buf.Bytes(), []byte(`micro_client_request_inflight{micro_endpoint="svc2.Service.Method"} 0`)) { + t.Fatalf("invalid metrics output: %s", buf.Bytes()) + } +} diff --git a/metric/victoriametrics/victoriametrics_test.go b/metric/victoriametrics/victoriametrics_test.go deleted file mode 100644 index 373bd0b..0000000 --- a/metric/victoriametrics/victoriametrics_test.go +++ /dev/null @@ -1,158 +0,0 @@ -//go:build ignore -// +build ignore - -package victoriametrics - -import ( - "bufio" - "bytes" - "context" - "fmt" - "io" - "strings" - "testing" - - metrics "github.com/VictoriaMetrics/metrics" - "github.com/stretchr/testify/assert" - gclient "go.unistack.org/micro-client-grpc/v3" - rrouter "go.unistack.org/micro-router-register/v3" - gserver "go.unistack.org/micro-server-grpc/v3" - "go.unistack.org/micro/v3/broker" - "go.unistack.org/micro/v3/client" - "go.unistack.org/micro/v3/router" - "go.unistack.org/micro/v3/server" -) - -type Test interface { - Method(ctx context.Context, in *TestRequest, opts ...client.CallOption) (*TestResponse, error) -} - -type TestRequest struct { - IsError bool -} -type TestResponse struct{} - -type testHandler struct{} - -func (t *testHandler) Method(ctx context.Context, req *TestRequest, rsp *TestResponse) error { - if req.IsError { - return fmt.Errorf("victoriametrics test error") - } - return nil -} - -func TestVictoriametrics(t *testing.T) { - // setup - r := register.NewRegister() - b := broker.NewBroker(broker.Register(r)) - - name := "test" - id := "id-1234567890" - version := "1.2.3.4" - - c := gclient.NewClient( - client.Router(rrouter.NewRouter(router.Register(r))), - client.Broker(b), - ) - s := gserver.NewServer( - server.Broker(b), - server.Name(name), - server.Version(version), - server.Id(id), - server.Register(r), - server.WrapHandler( - NewHandlerWrapper( - ServiceName(name), - ServiceVersion(version), - ServiceID(id), - ), - ), - ) - if err := s.Init(); err != nil { - t.Fatal(err) - } - defer s.Stop() - - type Test struct { - *testHandler - } - - s.Handle( - s.NewHandler(&Test{new(testHandler)}), - ) - - if err := s.Start(); err != nil { - t.Fatalf("Unexpected error starting server: %v", err) - } - - req := c.NewRequest(name, "Test.Method", &TestRequest{IsError: false}, client.WithContentType("application/json")) - rsp := TestResponse{} - - assert.NoError(t, c.Call(context.TODO(), req, &rsp)) - - req = c.NewRequest(name, "Test.Method", &TestRequest{IsError: true}, client.WithContentType("application/json")) - assert.Error(t, c.Call(context.TODO(), req, &rsp)) - - buf := bytes.NewBuffer(nil) - metrics.WritePrometheus(buf, false) - - metric, err := findMetricByName(buf, "sum", "micro_server_request_total") - if err != nil { - t.Fatal(err) - } - - labels := metric[0]["labels"].(map[string]string) - for k, v := range labels { - switch k { - case "micro_version": - assert.Equal(t, version, v) - case "micro_id": - assert.Equal(t, id, v) - case "micro_name": - assert.Equal(t, name, v) - case "micro_endpoint": - assert.Equal(t, "Test.Method", v) - case "micro_status": - continue - default: - t.Fatalf("unknown %v with %v", k, v) - } - } -} - -func findMetricByName(buf io.Reader, tp string, name string) ([]map[string]interface{}, error) { - var metrics []map[string]interface{} - scanner := bufio.NewScanner(buf) - for scanner.Scan() { - txt := scanner.Text() - if strings.HasPrefix(txt, name) { - mt := make(map[string]interface{}) - v := txt[strings.LastIndex(txt, " "):] - k := "" - if idx := strings.Index(txt, "{"); idx > 0 { - labels := make(map[string]string) - lb := strings.Split(txt[idx+1:strings.Index(txt, "}")], ",") - for _, l := range lb { - p := strings.Split(l, "=") - labels[strings.Trim(p[0], `"`)] = strings.Trim(p[1], `"`) - } - mt["labels"] = labels - k = txt[:idx] - } else { - k = txt[:strings.Index(txt, " ")] - } - mt["name"] = k - mt["value"] = v - metrics = append(metrics, mt) - } - } - - if err := scanner.Err(); err != nil { - return nil, err - } - - if len(metrics) == 0 { - return nil, fmt.Errorf("%s %s not found", tp, name) - } - return metrics, nil -} -- 2.45.2 From 7149f1fda80ee53b0e3ba9bea6a6315643ab2f64 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 22 Nov 2021 10:16:17 +0300 Subject: [PATCH 2/4] server/http: add test for wrapped router Signed-off-by: Vasiliy Tolstov --- server/http/http_test.go | 70 ++++++++++++++++++++++++++++++++++------ 1 file changed, 61 insertions(+), 9 deletions(-) diff --git a/server/http/http_test.go b/server/http/http_test.go index 5d640b8..08d4ac8 100644 --- a/server/http/http_test.go +++ b/server/http/http_test.go @@ -10,6 +10,7 @@ import ( "net/http" "net/url" "strings" + "sync" "testing" httpcli "go.unistack.org/micro-client-http/v3" @@ -270,8 +271,8 @@ func TestNativeFormUrlencoded(t *testing.T) { // make request req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("http://%s/v1/test/call/my_name", service[0].Nodes[0].Address), strings.NewReader(data.Encode())) // URL-encoded payload req.Header.Add("Content-Type", "application/x-www-form-urlencoded") -req.Header.Add("Clientid", "1234567890") -req.AddCookie(&http.Cookie{Name:"Csrftoken", Value: "csrftoken"}) + req.Header.Add("Clientid", "1234567890") + req.AddCookie(&http.Cookie{Name: "Csrftoken", Value: "csrftoken"}) // req.Header.Add("Content-Length", strconv.Itoa(len(data.Encode()))) if err != nil { t.Fatal(err) @@ -425,8 +426,8 @@ func TestNativeClientServer(t *testing.T) { } hb, err := jsonpbcodec.NewCodec().Marshal(&pb.CallReq{ - Clientid: "1234567890", - Csrftoken: "csrftoken", + Clientid: "1234567890", + Csrftoken: "csrftoken", Nested: &pb.Nested{Uint64Args: []*wrapperspb.UInt64Value{ &wrapperspb.UInt64Value{Value: 1}, &wrapperspb.UInt64Value{Value: 2}, @@ -704,23 +705,39 @@ func TestHTTPHandler(t *testing.T) { } } +type handlerSwapper struct { + mu sync.RWMutex + handler http.Handler +} + +func (h *handlerSwapper) ServeHTTP(w http.ResponseWriter, r *http.Request) { + h.mu.RLock() + handler := h.handler + h.mu.RUnlock() + handler.ServeHTTP(w, r) +} + func TestHTTPServer(t *testing.T) { reg := register.NewRegister() ctx := context.Background() // create server mux - mux := http.NewServeMux() - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux1 := http.NewServeMux() + mux1.HandleFunc("/first", func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte(`hello world`)) + }) + mux2 := http.NewServeMux() + mux2.HandleFunc("/second", func(w http.ResponseWriter, r *http.Request) { _, _ = w.Write([]byte(`hello world`)) }) + h := &handlerSwapper{handler: mux1} // create server srv := httpsrv.NewServer( server.Address("127.0.0.1:0"), server.Register(reg), - httpsrv.Server(&http.Server{Handler: mux}), + httpsrv.Server(&http.Server{Handler: h}), server.Codec("application/json", jsoncodec.NewCodec()), - server.Codec("application/x-www-form-urlencoded", urlencodecodec.NewCodec()), ) if err := srv.Init(); err != nil { @@ -747,7 +764,7 @@ func TestHTTPServer(t *testing.T) { } // make request - rsp, err := http.Get(fmt.Sprintf("http://%s", service[0].Nodes[0].Address)) + rsp, err := http.Get(fmt.Sprintf("http://%s/first", service[0].Nodes[0].Address)) if err != nil { t.Fatal(err) } @@ -762,6 +779,41 @@ func TestHTTPServer(t *testing.T) { t.Fatalf("Expected response %s, got %s", "hello world", s) } + rsp, err = http.Get(fmt.Sprintf("http://%s/second", service[0].Nodes[0].Address)) + if err != nil { + t.Fatal(err) + } + if rsp.StatusCode != 404 { + t.Fatal("second route must not exists") + } + h.mu.Lock() + h.handler = mux2 + h.mu.Unlock() + + rsp, err = http.Get(fmt.Sprintf("http://%s/first", service[0].Nodes[0].Address)) + if err != nil { + t.Fatal(err) + } + defer rsp.Body.Close() + if rsp.StatusCode != 404 { + t.Fatal("first route must not exists") + } + + rsp, err = http.Get(fmt.Sprintf("http://%s/second", service[0].Nodes[0].Address)) + if err != nil { + t.Fatal(err) + } + defer rsp.Body.Close() + + b, err = ioutil.ReadAll(rsp.Body) + if err != nil { + t.Fatal(err) + } + + if s := string(b); s != "hello world" { + t.Fatalf("Expected response %s, got %s", "hello world", s) + } + // stop server if err := srv.Stop(); err != nil { t.Fatal(err) -- 2.45.2 From 8bc61c174d2174734b2d754e7945832fa1d1dcb5 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 29 Dec 2021 01:55:46 +0300 Subject: [PATCH 3/4] update deps Signed-off-by: Vasiliy Tolstov --- go.mod | 6 +++++- go.sum | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index f41debe..cf78ebd 100644 --- a/go.mod +++ b/go.mod @@ -35,7 +35,11 @@ require ( go.unistack.org/micro-wrapper-sql/v3 v3.0.1 go.unistack.org/micro-wrapper-trace-opentracing/v3 v3.8.0 go.unistack.org/micro/v3 v3.8.13 - google.golang.org/grpc v1.42.0 + golang.org/x/net v0.0.0-20211216030914-fe4d6282115f // indirect + golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb // indirect + google.golang.org/grpc v1.43.0 google.golang.org/protobuf v1.27.1 modernc.org/sqlite v1.14.1 storj.io/drpc v0.0.26 diff --git a/go.sum b/go.sum index cd206e0..6162497 100644 --- a/go.sum +++ b/go.sum @@ -484,6 +484,8 @@ golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211123203042-d83791d6bcd9 h1:0qxwC5n+ttVOINCBeRHO0nq9X7uy8SDsPoi5OaCdIEI= golang.org/x/net v0.0.0-20211123203042-d83791d6bcd9/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211216030914-fe4d6282115f h1:hEYJvxw1lSnWIl8X9ofsYMklzaDs90JI2az5YMd4fPM= +golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 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-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -531,6 +533,8 @@ golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac h1:oN6lz7iLW/YC7un8pq+9bOLyXrprv2+DKfkJY+2LJJw= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 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= @@ -538,6 +542,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -566,6 +572,8 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210729151513-df9385d47c1b h1:4xoALQmXxqVdDdLimpPyPeDdsJzo+nFTJw9euAMpqgM= google.golang.org/genproto v0.0.0-20210729151513-df9385d47c1b/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb h1:ZrsicilzPCS/Xr8qtBZZLpy4P9TYXAfl49ctG1/5tgw= +google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -579,6 +587,8 @@ google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9K google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= +google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -- 2.45.2 From 0e6f6b425cb35b39d0d2a373fa33b318e6966fde Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 29 Dec 2021 02:05:30 +0300 Subject: [PATCH 4/4] regen Signed-off-by: Vasiliy Tolstov --- client/drpc/proto/test.pb.go | 2 +- client/grpc/generate.go | 2 +- client/grpc/proto/test.pb.go | 2 +- client/grpc/proto/test_grpc.pb.go | 4 ++++ client/http/proto/github.pb.go | 2 +- codec/proto/test.pb.go | 2 +- codec/segmentio/proto/test.pb.go | 2 +- flow/proto/test.pb.go | 2 +- protoc-gen-go-micro/proto/test_micro_http.pb.go | 2 +- server/grpc/proto/test.pb.go | 2 +- server/grpc/proto/test_grpc.pb.go | 4 ++++ server/http/proto/test.pb.go | 2 +- server/http/proto/test_micro_http.pb.go | 2 +- util/reflect/proto/test.pb.go | 2 +- 14 files changed, 20 insertions(+), 12 deletions(-) diff --git a/client/drpc/proto/test.pb.go b/client/drpc/proto/test.pb.go index 64540a9..feb9ae9 100644 --- a/client/drpc/proto/test.pb.go +++ b/client/drpc/proto/test.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.17.3 +// protoc v3.19.1 // source: test.proto package pb diff --git a/client/grpc/generate.go b/client/grpc/generate.go index a80be72..99e2d67 100644 --- a/client/grpc/generate.go +++ b/client/grpc/generate.go @@ -1,4 +1,4 @@ package grpc -//go:generate go install google.golang.org/grpc/cmd/protoc-gen-go-grpc +//go:generate go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest //go:generate protoc -I./proto -I. --go-grpc_out=paths=source_relative:./proto --go_out=paths=source_relative:./proto --go-micro_out=components=micro|rpc,standalone=true,paths=source_relative:./gproto proto/test.proto diff --git a/client/grpc/proto/test.pb.go b/client/grpc/proto/test.pb.go index d8fa034..3ec7e06 100644 --- a/client/grpc/proto/test.pb.go +++ b/client/grpc/proto/test.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.17.3 +// protoc v3.19.1 // source: test.proto package helloworld diff --git a/client/grpc/proto/test_grpc.pb.go b/client/grpc/proto/test_grpc.pb.go index 975623b..80a8872 100644 --- a/client/grpc/proto/test_grpc.pb.go +++ b/client/grpc/proto/test_grpc.pb.go @@ -1,4 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.19.1 +// source: test.proto package helloworld diff --git a/client/http/proto/github.pb.go b/client/http/proto/github.pb.go index b9e0fba..9bbcd7a 100644 --- a/client/http/proto/github.pb.go +++ b/client/http/proto/github.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.17.3 +// protoc v3.19.1 // source: github.proto package pb diff --git a/codec/proto/test.pb.go b/codec/proto/test.pb.go index 8e6e71a..a8fceeb 100644 --- a/codec/proto/test.pb.go +++ b/codec/proto/test.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.17.3 +// protoc v3.19.1 // source: test.proto package pb diff --git a/codec/segmentio/proto/test.pb.go b/codec/segmentio/proto/test.pb.go index fa8a9ab..c1dc4ef 100644 --- a/codec/segmentio/proto/test.pb.go +++ b/codec/segmentio/proto/test.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.17.3 +// protoc v3.19.1 // source: test.proto package pb diff --git a/flow/proto/test.pb.go b/flow/proto/test.pb.go index f9b00c1..2853a19 100644 --- a/flow/proto/test.pb.go +++ b/flow/proto/test.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.17.3 +// protoc v3.19.1 // source: test.proto package pb diff --git a/protoc-gen-go-micro/proto/test_micro_http.pb.go b/protoc-gen-go-micro/proto/test_micro_http.pb.go index 341dd1d..fa62075 100644 --- a/protoc-gen-go-micro/proto/test_micro_http.pb.go +++ b/protoc-gen-go-micro/proto/test_micro_http.pb.go @@ -30,8 +30,8 @@ func (c *testServiceClient) TestEndpoint(ctx context.Context, req *Request, opts v3.Path("/users/test"), ) opts = append(opts, - v3.Header("client_uid", "true"), v3.Cookie("csrftoken", "true"), + v3.Header("client_uid", "true"), ) rsp := &Response{} err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.TestEndpoint", req), rsp, opts...) diff --git a/server/grpc/proto/test.pb.go b/server/grpc/proto/test.pb.go index 138c97e..f426a44 100644 --- a/server/grpc/proto/test.pb.go +++ b/server/grpc/proto/test.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.17.3 +// protoc v3.19.1 // source: test.proto package helloworld diff --git a/server/grpc/proto/test_grpc.pb.go b/server/grpc/proto/test_grpc.pb.go index c43d288..0bb51e6 100644 --- a/server/grpc/proto/test_grpc.pb.go +++ b/server/grpc/proto/test_grpc.pb.go @@ -1,4 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.19.1 +// source: test.proto package helloworld diff --git a/server/http/proto/test.pb.go b/server/http/proto/test.pb.go index 5c58a58..a2b932b 100644 --- a/server/http/proto/test.pb.go +++ b/server/http/proto/test.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.17.3 +// protoc v3.19.1 // source: test.proto package pb diff --git a/server/http/proto/test_micro_http.pb.go b/server/http/proto/test_micro_http.pb.go index f76aaa4..b5f697e 100644 --- a/server/http/proto/test_micro_http.pb.go +++ b/server/http/proto/test_micro_http.pb.go @@ -111,8 +111,8 @@ func (c *testClient) Call(ctx context.Context, req *CallReq, opts ...client.Call v3.Body("*"), ) opts = append(opts, - v3.Cookie("Csrftoken", "true"), v3.Header("Clientid", "true"), + v3.Cookie("Csrftoken", "true"), ) opts = append(opts, client.WithRequestTimeout(time.Second*5)) rsp := &CallRsp{} diff --git a/util/reflect/proto/test.pb.go b/util/reflect/proto/test.pb.go index e33fb27..bc9e0e5 100644 --- a/util/reflect/proto/test.pb.go +++ b/util/reflect/proto/test.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.17.3 +// protoc v3.19.1 // source: test.proto package pb -- 2.45.2