From 04703cb8fa7ac52286f189b365cfe5773d8803e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Mar 2022 09:43:58 +0000 Subject: [PATCH 01/49] Bump golangci/golangci-lint-action from 2 to 3.1.0 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 2 to 3.1.0. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v2...v3.1.0) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- .github/workflows/pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb19b68..62ec8bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,7 @@ jobs: - name: checkout uses: actions/checkout@v2 - name: lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3.1.0 continue-on-error: true with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 545baf2..3567fbd 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -33,7 +33,7 @@ jobs: - name: checkout uses: actions/checkout@v2 - name: lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3.1.0 continue-on-error: true with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. -- 2.45.2 From 4618fae64166b27b21dcfa6f6bed76b8cd66b039 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 7 Mar 2022 13:46:39 +0300 Subject: [PATCH 02/49] update go version Signed-off-by: Vasiliy Tolstov --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/pr.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62ec8bc..f0f7cc9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: - name: setup uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - name: checkout uses: actions/checkout@v2 - name: cache diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b50aad2..429992c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -47,7 +47,7 @@ jobs: - name: setup uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 # Initializes the CodeQL tools for scanning. - name: init uses: github/codeql-action/init@v1 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3567fbd..8f4449f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -11,7 +11,7 @@ jobs: - name: setup uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - name: checkout uses: actions/checkout@v2 - name: cache -- 2.45.2 From 4ce1ef631bed27d167da198fc2b74a96986ae45d Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 21 Mar 2022 15:29:40 +0300 Subject: [PATCH 03/49] server: remove unparsed body from request and message Signed-off-by: Vasiliy Tolstov --- go.mod | 2 +- go.sum | 16 +++++++++++----- handler.go | 1 - message.go | 8 ++------ request.go | 8 +------- subscriber.go | 3 +-- 6 files changed, 16 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index 32abb3f..898dce2 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.8.21 + go.unistack.org/micro/v3 v3.9.0 golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba ) diff --git a/go.sum b/go.sum index 5d2e27d..68649c6 100644 --- a/go.sum +++ b/go.sum @@ -22,7 +22,7 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.4.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 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= @@ -37,7 +37,9 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/gnostic v0.6.6 h1:MVSM2r2j9aRUvYNym66JGW96Ddd5MN4sTi59yktb6yk= github.com/google/gnostic v0.6.6/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= 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= @@ -49,8 +51,10 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= @@ -67,10 +71,10 @@ github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2 github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.unistack.org/micro-proto/v3 v3.2.1 h1:z7+V97LcAwMbBiYStmf8b6fFk2UPJTzni+rxNqk4NrI= -go.unistack.org/micro-proto/v3 v3.2.1/go.mod h1:ZltVWNECD5yK+40+OCONzGw4OtmSdTpVi8/KFgo9dqM= -go.unistack.org/micro/v3 v3.8.21 h1:8vYxtIlPnCBZ888BrQSP6+b0CFQcn5FiaqDpI5XqorQ= -go.unistack.org/micro/v3 v3.8.21/go.mod h1:aBOCQ6SkAwKMRI7Q1CIsQA2S88ibyJfweJZlT1M2qpE= +go.unistack.org/micro-proto/v3 v3.2.7 h1:zG6d69kHc+oij2lwQ3AfrCgdjiEVRG2A7TlsxjusWs4= +go.unistack.org/micro-proto/v3 v3.2.7/go.mod h1:ZltVWNECD5yK+40+OCONzGw4OtmSdTpVi8/KFgo9dqM= +go.unistack.org/micro/v3 v3.9.0 h1:n5w7Y0QlFA0Rhh5XON1f1MfdmY+4BMQopYmX6Uy7tdU= +go.unistack.org/micro/v3 v3.9.0/go.mod h1:7ssIWk+PJXvb2nSl8NUnQRs32JJEId2IDi9PobrQlKo= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= @@ -148,11 +152,13 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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= diff --git a/handler.go b/handler.go index a555f43..fbd6987 100644 --- a/handler.go +++ b/handler.go @@ -210,7 +210,6 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { service: handler.sopts.Name, contentType: ct, method: fmt.Sprintf("%s.%s", hldr.name, hldr.mtype.method.Name), - body: buf, payload: argv.Interface(), header: md, } diff --git a/message.go b/message.go index f6d3763..2146e5c 100644 --- a/message.go +++ b/message.go @@ -18,10 +18,6 @@ func (r *httpMessage) Topic() string { return r.topic } -func (r *httpMessage) Payload() interface{} { - return r.payload -} - func (r *httpMessage) ContentType() string { return r.contentType } @@ -30,8 +26,8 @@ func (r *httpMessage) Header() metadata.Metadata { return r.header } -func (r *httpMessage) Body() []byte { - return r.body +func (r *httpMessage) Body() interface{} { + return r.payload } func (r *httpMessage) Codec() codec.Codec { diff --git a/request.go b/request.go index 4afa92d..092f33e 100644 --- a/request.go +++ b/request.go @@ -22,7 +22,6 @@ type rpcRequest struct { endpoint string contentType string service string - body []byte stream bool } @@ -32,7 +31,6 @@ type rpcMessage struct { header metadata.Metadata topic string contentType string - body []byte } func (r *rpcRequest) ContentType() string { @@ -83,7 +81,7 @@ func (r *rpcMessage) Topic() string { return r.topic } -func (r *rpcMessage) Payload() interface{} { +func (r *rpcMessage) Body() interface{} { return r.payload } @@ -91,10 +89,6 @@ func (r *rpcMessage) Header() metadata.Metadata { return r.header } -func (r *rpcMessage) Body() []byte { - return r.body -} - func (r *rpcMessage) Codec() codec.Codec { return r.codec } diff --git a/subscriber.go b/subscriber.go index 8880a95..974ec06 100644 --- a/subscriber.go +++ b/subscriber.go @@ -151,7 +151,7 @@ func (s *httpServer) createSubHandler(sb *httpSubscriber, opts server.Options) b vals = append(vals, reflect.ValueOf(ctx)) } - vals = append(vals, reflect.ValueOf(msg.Payload())) + vals = append(vals, reflect.ValueOf(msg.Body())) returnValues := handler.method.Call(vals) if err := returnValues[0].Interface(); err != nil { @@ -170,7 +170,6 @@ func (s *httpServer) createSubHandler(sb *httpSubscriber, opts server.Options) b contentType: ct, payload: req.Interface(), header: msg.Header, - body: msg.Body, codec: cf, }) }() -- 2.45.2 From 1cc8b3750338387b78b92da51429868bcbcac266 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 21 Mar 2022 15:41:40 +0300 Subject: [PATCH 04/49] comment Signed-off-by: Vasiliy Tolstov --- http.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/http.go b/http.go index 8e99d7d..4a61dfd 100644 --- a/http.go +++ b/http.go @@ -184,14 +184,17 @@ func (h *httpServer) NewHandler(handler interface{}, opts ...server.HandlerOptio tp := reflect.TypeOf(handler) - if len(options.Metadata) == 0 { - if h.registerRPC { - h.opts.Logger.Infof(h.opts.Context, "register rpc handler for http.MethodPost %s /%s", hn, hn) - if err := hdlr.handlers.Insert([]string{http.MethodPost}, "/"+hn, pth); err != nil { - h.opts.Logger.Errorf(h.opts.Context, "cant add rpc handler for http.MethodPost %s /%s", hn, hn) + /* + if len(options.Metadata) == 0 { + if h.registerRPC { + h.opts.Logger.Infof(h.opts.Context, "register rpc handler for http.MethodPost %s /%s", hn, hn) + if err := hdlr.handlers.Insert([]string{http.MethodPost}, "/"+hn, pth); err != nil { + h.opts.Logger.Errorf(h.opts.Context, "cant add rpc handler for http.MethodPost %s /%s", hn, hn) + } } } - } + */ + for hn, md := range options.Metadata { var method reflect.Method mname := hn[strings.Index(hn, ".")+1:] -- 2.45.2 From 0124e922e5111270ed367f17118197f804cfdfd3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Mar 2022 17:20:17 +0000 Subject: [PATCH 05/49] Bump go.unistack.org/micro/v3 from 3.9.0 to 3.9.1 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.0 to 3.9.1. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.9.0...v3.9.1) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 898dce2..3159d19 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.9.0 + go.unistack.org/micro/v3 v3.9.1 golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba ) diff --git a/go.sum b/go.sum index 68649c6..878c650 100644 --- a/go.sum +++ b/go.sum @@ -73,8 +73,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.2.7 h1:zG6d69kHc+oij2lwQ3AfrCgdjiEVRG2A7TlsxjusWs4= go.unistack.org/micro-proto/v3 v3.2.7/go.mod h1:ZltVWNECD5yK+40+OCONzGw4OtmSdTpVi8/KFgo9dqM= -go.unistack.org/micro/v3 v3.9.0 h1:n5w7Y0QlFA0Rhh5XON1f1MfdmY+4BMQopYmX6Uy7tdU= -go.unistack.org/micro/v3 v3.9.0/go.mod h1:7ssIWk+PJXvb2nSl8NUnQRs32JJEId2IDi9PobrQlKo= +go.unistack.org/micro/v3 v3.9.1 h1:C1TEP8Eooqr5vlNLoZ3LCpNqk+XuCiC1yBHol+qJZ4E= +go.unistack.org/micro/v3 v3.9.1/go.mod h1:7ssIWk+PJXvb2nSl8NUnQRs32JJEId2IDi9PobrQlKo= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= -- 2.45.2 From ad44db22b9de0c3408b19c677bcb68ecb8b89370 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Mar 2022 17:41:29 +0000 Subject: [PATCH 06/49] Bump actions/cache from 2 to 3 Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3. - [Release notes](https://github.com/actions/cache/releases) - [Commits](https://github.com/actions/cache/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- .github/workflows/pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ddc5253..958bd05 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: - name: checkout uses: actions/checkout@v3 - name: cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b6a6345..4fc074b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -16,7 +16,7 @@ jobs: - name: checkout uses: actions/checkout@v3 - name: cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} -- 2.45.2 From 47786523cc146da787001ff426bc40184f3f8f2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Mar 2022 17:20:25 +0000 Subject: [PATCH 07/49] Bump go.unistack.org/micro/v3 from 3.9.1 to 3.9.2 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.1 to 3.9.2. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.9.1...v3.9.2) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3159d19..cf99bfb 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.9.1 + go.unistack.org/micro/v3 v3.9.2 golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba ) diff --git a/go.sum b/go.sum index 878c650..0f9f5fe 100644 --- a/go.sum +++ b/go.sum @@ -73,8 +73,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.2.7 h1:zG6d69kHc+oij2lwQ3AfrCgdjiEVRG2A7TlsxjusWs4= go.unistack.org/micro-proto/v3 v3.2.7/go.mod h1:ZltVWNECD5yK+40+OCONzGw4OtmSdTpVi8/KFgo9dqM= -go.unistack.org/micro/v3 v3.9.1 h1:C1TEP8Eooqr5vlNLoZ3LCpNqk+XuCiC1yBHol+qJZ4E= -go.unistack.org/micro/v3 v3.9.1/go.mod h1:7ssIWk+PJXvb2nSl8NUnQRs32JJEId2IDi9PobrQlKo= +go.unistack.org/micro/v3 v3.9.2 h1:qXgiNFHvxHOsvMserufPtrtlnlHYSshfk83tNbqBYFY= +go.unistack.org/micro/v3 v3.9.2/go.mod h1:7ssIWk+PJXvb2nSl8NUnQRs32JJEId2IDi9PobrQlKo= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= -- 2.45.2 From 1c9f81edd416c5be77332c25dd61dc19641a7433 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Mar 2022 17:23:06 +0000 Subject: [PATCH 08/49] Bump go.unistack.org/micro/v3 from 3.9.2 to 3.9.5 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.2 to 3.9.5. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.9.2...v3.9.5) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index cf99bfb..beb2ead 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.9.2 + go.unistack.org/micro/v3 v3.9.5 golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba ) diff --git a/go.sum b/go.sum index 0f9f5fe..67eaed9 100644 --- a/go.sum +++ b/go.sum @@ -73,8 +73,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.2.7 h1:zG6d69kHc+oij2lwQ3AfrCgdjiEVRG2A7TlsxjusWs4= go.unistack.org/micro-proto/v3 v3.2.7/go.mod h1:ZltVWNECD5yK+40+OCONzGw4OtmSdTpVi8/KFgo9dqM= -go.unistack.org/micro/v3 v3.9.2 h1:qXgiNFHvxHOsvMserufPtrtlnlHYSshfk83tNbqBYFY= -go.unistack.org/micro/v3 v3.9.2/go.mod h1:7ssIWk+PJXvb2nSl8NUnQRs32JJEId2IDi9PobrQlKo= +go.unistack.org/micro/v3 v3.9.5 h1:7/eOStEdisufp8WdrFjwVnWWWduouSQOaZoUyS4KeMQ= +go.unistack.org/micro/v3 v3.9.5/go.mod h1:7ssIWk+PJXvb2nSl8NUnQRs32JJEId2IDi9PobrQlKo= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= -- 2.45.2 From 9711b1b4ed2fa0f16bc60ddd1693f682ed11e7b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 17:19:07 +0000 Subject: [PATCH 09/49] Bump go.unistack.org/micro/v3 from 3.9.5 to 3.9.7 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.5 to 3.9.7. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.9.5...v3.9.7) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index beb2ead..e6d8b0e 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.9.5 + go.unistack.org/micro/v3 v3.9.7 golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba ) diff --git a/go.sum b/go.sum index 67eaed9..203256f 100644 --- a/go.sum +++ b/go.sum @@ -22,7 +22,7 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/golang-jwt/jwt/v4 v4.4.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 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= @@ -73,8 +73,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.2.7 h1:zG6d69kHc+oij2lwQ3AfrCgdjiEVRG2A7TlsxjusWs4= go.unistack.org/micro-proto/v3 v3.2.7/go.mod h1:ZltVWNECD5yK+40+OCONzGw4OtmSdTpVi8/KFgo9dqM= -go.unistack.org/micro/v3 v3.9.5 h1:7/eOStEdisufp8WdrFjwVnWWWduouSQOaZoUyS4KeMQ= -go.unistack.org/micro/v3 v3.9.5/go.mod h1:7ssIWk+PJXvb2nSl8NUnQRs32JJEId2IDi9PobrQlKo= +go.unistack.org/micro/v3 v3.9.7 h1:ROx4X6nP9rE72lKgawyys/8VdNXqU65fb3he7d00iZk= +go.unistack.org/micro/v3 v3.9.7/go.mod h1:E1pmj0cNC7P+QVX1sElRBMiNaQVTjDoEtYlbqZY84c4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= -- 2.45.2 From a2a83bbae5eee21f598ef9051816d0db1770e73f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Apr 2022 17:17:24 +0000 Subject: [PATCH 10/49] Bump actions/setup-go from 2 to 3 Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/pr.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 958bd05..ae83070 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: setup - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: 1.17 - name: checkout diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b3d478e..bf6299c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -45,7 +45,7 @@ jobs: - name: checkout uses: actions/checkout@v3 - name: setup - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: 1.17 # Initializes the CodeQL tools for scanning. diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4fc074b..68510b4 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: setup - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: 1.17 - name: checkout -- 2.45.2 From f5db9193deea0ef12d5333ae5273121c4f09d118 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 23:49:41 +0300 Subject: [PATCH 11/49] Bump dependabot/fetch-metadata from 1.3.0 to 1.3.1 (#112) Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.0 to 1.3.1. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.0...v1.3.1) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependabot-automerge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml index 3681028..7cf424b 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/dependabot-automerge.yml @@ -15,7 +15,7 @@ jobs: steps: - name: metadata id: metadata - uses: dependabot/fetch-metadata@v1.3.0 + uses: dependabot/fetch-metadata@v1.3.1 with: github-token: "${{ secrets.TOKEN }}" - name: merge -- 2.45.2 From 31e882cc1e771e8dea9cbe4db41ef9723cf8fa92 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Apr 2022 23:42:10 +0300 Subject: [PATCH 12/49] Bump github/codeql-action from 1 to 2 (#113) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v1...v2) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index bf6299c..2f6c6de 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -50,7 +50,7 @@ jobs: go-version: 1.17 # Initializes the CodeQL tools for scanning. - name: init - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -61,7 +61,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -75,4 +75,4 @@ jobs: # make release - name: analyze - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 -- 2.45.2 From 685951339e46c0857babc786f890a0bc2e8afa4e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 May 2022 17:22:48 +0000 Subject: [PATCH 13/49] Bump go.unistack.org/micro/v3 from 3.9.7 to 3.9.8 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.7 to 3.9.8. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.9.7...v3.9.8) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 26 ++++++++++++++++---------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index e6d8b0e..36ff9f6 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.9.7 - golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba + go.unistack.org/micro/v3 v3.9.8 + golang.org/x/net v0.0.0-20220225172249-27dd8689420f ) diff --git a/go.sum b/go.sum index 203256f..a5bb1a3 100644 --- a/go.sum +++ b/go.sum @@ -10,6 +10,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= @@ -39,23 +40,27 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/gnostic v0.6.6 h1:MVSM2r2j9aRUvYNym66JGW96Ddd5MN4sTi59yktb6yk= github.com/google/gnostic v0.6.6/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= +github.com/google/gnostic v0.6.8 h1:bT56GPYBWh1tvBuBEd94qcS3+60b+y0HQur0ITkGuCk= +github.com/google/gnostic v0.6.8/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= 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/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -73,8 +78,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.2.7 h1:zG6d69kHc+oij2lwQ3AfrCgdjiEVRG2A7TlsxjusWs4= go.unistack.org/micro-proto/v3 v3.2.7/go.mod h1:ZltVWNECD5yK+40+OCONzGw4OtmSdTpVi8/KFgo9dqM= -go.unistack.org/micro/v3 v3.9.7 h1:ROx4X6nP9rE72lKgawyys/8VdNXqU65fb3he7d00iZk= -go.unistack.org/micro/v3 v3.9.7/go.mod h1:E1pmj0cNC7P+QVX1sElRBMiNaQVTjDoEtYlbqZY84c4= +go.unistack.org/micro/v3 v3.9.8 h1:wnNVO3JH+hNK9Hw07iWQ8jcQYnMRPvyYCZRc2IJvymg= +go.unistack.org/micro/v3 v3.9.8/go.mod h1:SKr1XwfDLsytOixTDei+Ek/tr2OpIjLd9Rg5ET9RqXs= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= @@ -90,9 +95,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba h1:6u6sik+bn/y7vILcYkK3iwTBWN7WtBvB0+SZswQnbf8= -golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 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= @@ -149,14 +153,16 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -- 2.45.2 From d5e0423985688a7bfdafdb16ca5048921d27725a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 Jun 2022 22:50:01 +0300 Subject: [PATCH 14/49] Bump golangci/golangci-lint-action from 3.1.0 to 3.2.0 (#115) Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.1.0 to 3.2.0. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v3.1.0...v3.2.0) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- .github/workflows/pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae83070..9c95dde 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: - name: checkout uses: actions/checkout@v3 - name: lint - uses: golangci/golangci-lint-action@v3.1.0 + uses: golangci/golangci-lint-action@v3.2.0 continue-on-error: true with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 68510b4..b7f1bcf 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -34,7 +34,7 @@ jobs: - name: checkout uses: actions/checkout@v3 - name: lint - uses: golangci/golangci-lint-action@v3.1.0 + uses: golangci/golangci-lint-action@v3.2.0 continue-on-error: true with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. -- 2.45.2 From 7d649e8156e6dcee9054a77e679cc47e91f08c82 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 27 Jun 2022 00:41:18 +0300 Subject: [PATCH 15/49] update to latest micro Signed-off-by: Vasiliy Tolstov --- go.mod | 13 +++++++++++-- go.sum | 30 +++++++++++++++++++++++------- http.go | 5 +---- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 898dce2..e2b1d69 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,15 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.9.0 - golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba + github.com/ef-ds/deque v1.0.4 // indirect + github.com/golang-jwt/jwt/v4 v4.4.0 // indirect + github.com/google/gnostic v0.6.9 // indirect + github.com/google/go-cmp v0.5.7 // indirect + github.com/kr/pretty v0.2.1 // indirect + github.com/kr/text v0.2.0 // indirect + go.unistack.org/micro/v3 v3.9.10 + golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/yaml.v2 v2.3.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 68649c6..996c07d 100644 --- a/go.sum +++ b/go.sum @@ -10,6 +10,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= @@ -39,23 +40,30 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/gnostic v0.6.6 h1:MVSM2r2j9aRUvYNym66JGW96Ddd5MN4sTi59yktb6yk= github.com/google/gnostic v0.6.6/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= +github.com/google/gnostic v0.6.8 h1:bT56GPYBWh1tvBuBEd94qcS3+60b+y0HQur0ITkGuCk= +github.com/google/gnostic v0.6.8/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= +github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= +github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= 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/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -75,6 +83,8 @@ go.unistack.org/micro-proto/v3 v3.2.7 h1:zG6d69kHc+oij2lwQ3AfrCgdjiEVRG2A7Tlsxju go.unistack.org/micro-proto/v3 v3.2.7/go.mod h1:ZltVWNECD5yK+40+OCONzGw4OtmSdTpVi8/KFgo9dqM= go.unistack.org/micro/v3 v3.9.0 h1:n5w7Y0QlFA0Rhh5XON1f1MfdmY+4BMQopYmX6Uy7tdU= go.unistack.org/micro/v3 v3.9.0/go.mod h1:7ssIWk+PJXvb2nSl8NUnQRs32JJEId2IDi9PobrQlKo= +go.unistack.org/micro/v3 v3.9.10 h1:MOLOM8sm3PthhkJVKiraUlOMDyQLAofKNCJakPN/JBw= +go.unistack.org/micro/v3 v3.9.10/go.mod h1:LrBm9Fsf4MbY8DlUbdwRTYJosMkN8wrtOQHoYBlMkz8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= @@ -91,8 +101,9 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba h1:6u6sik+bn/y7vILcYkK3iwTBWN7WtBvB0+SZswQnbf8= -golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 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= @@ -109,6 +120,7 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/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-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -149,8 +161,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -160,5 +173,8 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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= diff --git a/http.go b/http.go index 4a61dfd..84c8678 100644 --- a/http.go +++ b/http.go @@ -109,10 +109,6 @@ func (h *httpServer) Init(opts ...server.Option) error { h.RUnlock() return err } - if err := h.opts.Auth.Init(); err != nil { - h.RUnlock() - return err - } if err := h.opts.Logger.Init(); err != nil { h.RUnlock() return err @@ -345,6 +341,7 @@ func (h *httpServer) Register() error { } opts = append(opts, broker.SubscribeContext(subCtx)) opts = append(opts, broker.SubscribeAutoAck(sb.Options().AutoAck)) + opts = append(opts, broker.SubscribeBodyOnly(sb.Options().BodyOnly)) sub, err := config.Broker.Subscribe(subCtx, sb.Topic(), handler, opts...) if err != nil { -- 2.45.2 From e8678e2da6d30769a3673c5e279e103edbb855a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Jul 2022 17:24:27 +0000 Subject: [PATCH 16/49] Bump go.unistack.org/micro/v3 from 3.9.10 to 3.9.11 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.10 to 3.9.11. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.9.10...v3.9.11) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 9 +-------- go.sum | 15 ++------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index e2b1d69..36f181b 100644 --- a/go.mod +++ b/go.mod @@ -3,15 +3,8 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - github.com/ef-ds/deque v1.0.4 // indirect - github.com/golang-jwt/jwt/v4 v4.4.0 // indirect github.com/google/gnostic v0.6.9 // indirect - github.com/google/go-cmp v0.5.7 // indirect - github.com/kr/pretty v0.2.1 // indirect - github.com/kr/text v0.2.0 // indirect - go.unistack.org/micro/v3 v3.9.10 + go.unistack.org/micro/v3 v3.9.11 golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e - google.golang.org/protobuf v1.28.0 // indirect - gopkg.in/yaml.v2 v2.3.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 4b86ba8..438c44b 100644 --- a/go.sum +++ b/go.sum @@ -14,7 +14,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/ef-ds/deque v1.0.4/go.mod h1:gXDnTC3yqvBcHbq2lcExjtAcVrOnJCbMcZXmuj8Z4tg= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -23,7 +22,6 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 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= @@ -41,7 +39,6 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/gnostic v0.6.6/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= -github.com/google/gnostic v0.6.8 h1:bT56GPYBWh1tvBuBEd94qcS3+60b+y0HQur0ITkGuCk= github.com/google/gnostic v0.6.8/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= @@ -55,7 +52,6 @@ github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= @@ -64,7 +60,6 @@ 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/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -81,8 +76,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.2.7 h1:zG6d69kHc+oij2lwQ3AfrCgdjiEVRG2A7TlsxjusWs4= go.unistack.org/micro-proto/v3 v3.2.7/go.mod h1:ZltVWNECD5yK+40+OCONzGw4OtmSdTpVi8/KFgo9dqM= -go.unistack.org/micro/v3 v3.9.10 h1:MOLOM8sm3PthhkJVKiraUlOMDyQLAofKNCJakPN/JBw= -go.unistack.org/micro/v3 v3.9.10/go.mod h1:LrBm9Fsf4MbY8DlUbdwRTYJosMkN8wrtOQHoYBlMkz8= +go.unistack.org/micro/v3 v3.9.11 h1:dsZVss3nvfByL1ZDJNnUVQB1N8w6qn4pr9vIkeBiii8= +go.unistack.org/micro/v3 v3.9.11/go.mod h1:LrBm9Fsf4MbY8DlUbdwRTYJosMkN8wrtOQHoYBlMkz8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= @@ -98,8 +93,6 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -117,7 +110,6 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w 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-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -167,10 +159,7 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogR gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -- 2.45.2 From 30ec3ae03ee6aa6bf2cef83757ce20072622226f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 28 Aug 2022 17:24:37 +0300 Subject: [PATCH 17/49] Bump dependabot/fetch-metadata from 1.3.1 to 1.3.3 (#118) Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.1 to 1.3.3. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.1...v1.3.3) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependabot-automerge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml index 7cf424b..1aa679d 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/dependabot-automerge.yml @@ -15,7 +15,7 @@ jobs: steps: - name: metadata id: metadata - uses: dependabot/fetch-metadata@v1.3.1 + uses: dependabot/fetch-metadata@v1.3.3 with: github-token: "${{ secrets.TOKEN }}" - name: merge -- 2.45.2 From 1bdd0103407141cf4c2984af3692ef7532bab017 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Oct 2022 12:50:27 +0300 Subject: [PATCH 18/49] Bump dependabot/fetch-metadata from 1.3.3 to 1.3.4 (#120) Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.3 to 1.3.4. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.3...v1.3.4) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependabot-automerge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml index 1aa679d..44105e8 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/dependabot-automerge.yml @@ -15,7 +15,7 @@ jobs: steps: - name: metadata id: metadata - uses: dependabot/fetch-metadata@v1.3.3 + uses: dependabot/fetch-metadata@v1.3.4 with: github-token: "${{ secrets.TOKEN }}" - name: merge -- 2.45.2 From bf0f643d78223f0437b758fa10c66aad35930bda Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 12 Nov 2022 18:20:42 +0300 Subject: [PATCH 19/49] Bump dependabot/fetch-metadata from 1.3.4 to 1.3.5 (#122) Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependabot-automerge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml index 44105e8..b8e71a1 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/dependabot-automerge.yml @@ -15,7 +15,7 @@ jobs: steps: - name: metadata id: metadata - uses: dependabot/fetch-metadata@v1.3.4 + uses: dependabot/fetch-metadata@v1.3.5 with: github-token: "${{ secrets.TOKEN }}" - name: merge -- 2.45.2 From 31b048858df4a4b443c77fa6a48e5645c13aa616 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 07:22:40 +0300 Subject: [PATCH 20/49] Bump golangci/golangci-lint-action from 3.2.0 to 3.3.1 (#123) Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.2.0 to 3.3.1. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v3.2.0...v3.3.1) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- .github/workflows/pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c95dde..66e730f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: - name: checkout uses: actions/checkout@v3 - name: lint - uses: golangci/golangci-lint-action@v3.2.0 + uses: golangci/golangci-lint-action@v3.3.1 continue-on-error: true with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b7f1bcf..14c16ea 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -34,7 +34,7 @@ jobs: - name: checkout uses: actions/checkout@v3 - name: lint - uses: golangci/golangci-lint-action@v3.2.0 + uses: golangci/golangci-lint-action@v3.3.1 continue-on-error: true with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. -- 2.45.2 From dd0e7e748dd06f1081ce2ca2685405ee083fa9a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 17:05:39 +0000 Subject: [PATCH 21/49] Bump go.unistack.org/micro/v3 from 3.9.11 to 3.9.13 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.11 to 3.9.13. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.9.11...v3.9.13) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 3 +-- go.sum | 14 ++++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 36f181b..1f8a21e 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,7 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - github.com/google/gnostic v0.6.9 // indirect - go.unistack.org/micro/v3 v3.9.11 + go.unistack.org/micro/v3 v3.9.13 golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 438c44b..59b10f0 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,6 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/gnostic v0.6.6/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= -github.com/google/gnostic v0.6.8/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -74,10 +72,10 @@ github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2 github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.unistack.org/micro-proto/v3 v3.2.7 h1:zG6d69kHc+oij2lwQ3AfrCgdjiEVRG2A7TlsxjusWs4= -go.unistack.org/micro-proto/v3 v3.2.7/go.mod h1:ZltVWNECD5yK+40+OCONzGw4OtmSdTpVi8/KFgo9dqM= -go.unistack.org/micro/v3 v3.9.11 h1:dsZVss3nvfByL1ZDJNnUVQB1N8w6qn4pr9vIkeBiii8= -go.unistack.org/micro/v3 v3.9.11/go.mod h1:LrBm9Fsf4MbY8DlUbdwRTYJosMkN8wrtOQHoYBlMkz8= +go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= +go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= +go.unistack.org/micro/v3 v3.9.13 h1:x1/H4rDgvz2JWXx6UvFiWDyRLxg2Kpp6V1kjzpLlyvo= +go.unistack.org/micro/v3 v3.9.13/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= @@ -152,8 +150,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -- 2.45.2 From 57758b4f808843e95d8407cf9decca3cb0e6ff57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Nov 2022 16:26:01 +0300 Subject: [PATCH 22/49] Bump hmarr/auto-approve-action from 2 to 3 (#125) Bumps [hmarr/auto-approve-action](https://github.com/hmarr/auto-approve-action) from 2 to 3. - [Release notes](https://github.com/hmarr/auto-approve-action/releases) - [Commits](https://github.com/hmarr/auto-approve-action/compare/v2...v3) --- updated-dependencies: - dependency-name: hmarr/auto-approve-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/autoapprove.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autoapprove.yml b/.github/workflows/autoapprove.yml index ebe28c9..5bf5d9f 100644 --- a/.github/workflows/autoapprove.yml +++ b/.github/workflows/autoapprove.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: approve - uses: hmarr/auto-approve-action@v2 + uses: hmarr/auto-approve-action@v3 if: github.actor == 'vtolstov' || github.actor == 'dependabot[bot]' id: approve with: -- 2.45.2 From 04b27524eee0dd4a94a1a77df41a3b6aeed0c447 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Nov 2022 17:05:54 +0000 Subject: [PATCH 23/49] Bump go.unistack.org/micro/v3 from 3.9.13 to 3.9.15 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.13 to 3.9.15. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.9.13...v3.9.15) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1f8a21e..2c0986d 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.9.13 + go.unistack.org/micro/v3 v3.9.15 golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 59b10f0..636d393 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= -go.unistack.org/micro/v3 v3.9.13 h1:x1/H4rDgvz2JWXx6UvFiWDyRLxg2Kpp6V1kjzpLlyvo= -go.unistack.org/micro/v3 v3.9.13/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= +go.unistack.org/micro/v3 v3.9.15 h1:Mv1/0jsySwIvm9+IvXTYj/X4bJCNChbwtf2ZV2ZDbk8= +go.unistack.org/micro/v3 v3.9.15/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= -- 2.45.2 From 740b5ee6359992bf1c3bc1be51d4f636f8e27b86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Dec 2022 17:06:05 +0000 Subject: [PATCH 24/49] Bump go.unistack.org/micro/v3 from 3.9.15 to 3.9.17 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.15 to 3.9.17. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.9.15...v3.9.17) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2c0986d..defb117 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.9.15 + go.unistack.org/micro/v3 v3.9.17 golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 636d393..0dd7c25 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= -go.unistack.org/micro/v3 v3.9.15 h1:Mv1/0jsySwIvm9+IvXTYj/X4bJCNChbwtf2ZV2ZDbk8= -go.unistack.org/micro/v3 v3.9.15/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= +go.unistack.org/micro/v3 v3.9.17 h1:EJ9/XR9OTo/up/3aqWjaKS2YsWMA66b0dx+pc/0vIl8= +go.unistack.org/micro/v3 v3.9.17/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= -- 2.45.2 From 05625d2df485a2999f5dc27aa6c3235e017afc85 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 27 Dec 2022 23:59:02 +0300 Subject: [PATCH 25/49] util/http: trie support method not allowed Signed-off-by: Vasiliy Tolstov --- go.mod | 2 +- go.sum | 4 ++-- handler.go | 14 ++++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index defb117..d25b367 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.9.17 + go.unistack.org/micro/v3 v3.9.18 golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 0dd7c25..0d399d1 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= -go.unistack.org/micro/v3 v3.9.17 h1:EJ9/XR9OTo/up/3aqWjaKS2YsWMA66b0dx+pc/0vIl8= -go.unistack.org/micro/v3 v3.9.17/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= +go.unistack.org/micro/v3 v3.9.18 h1:FNsCCJJKyyP9gScc1K3HxGxFjub+c4ZQpL+QwVvIMro= +go.unistack.org/micro/v3 v3.9.18/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= diff --git a/handler.go b/handler.go index fbd6987..426e979 100644 --- a/handler.go +++ b/handler.go @@ -62,7 +62,7 @@ func (h *httpHandler) Options() server.HandlerOptions { func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { // check for http.HandlerFunc handlers - if ph, _, ok := h.pathHandlers.Search(r.Method, r.URL.Path); ok { + if ph, _, err := h.pathHandlers.Search(r.Method, r.URL.Path); err == nil { ph.(http.HandlerFunc)(w, r) return } @@ -106,8 +106,8 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { for _, shdlr := range h.handlers { hdlr := shdlr.(*httpHandler) - fh, mp, ok := hdlr.handlers.Search(r.Method, path) - if ok { + fh, mp, err := hdlr.handlers.Search(r.Method, path) + if err == nil { match = true for k, v := range mp { matches[k] = v @@ -115,6 +115,8 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { hldr = fh.(*patHandler) handler = hdlr break + } else if err == rhttp.ErrMethodNotAllowed && !h.registerRPC { + h.errorHandler(ctx, nil, w, r, fmt.Errorf("not matching route found"), http.StatusNotFound) } } @@ -125,8 +127,8 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { if len(serviceMethod) == 2 { if shdlr, ok := h.handlers[serviceMethod[0]]; ok { hdlr := shdlr.(*httpHandler) - fh, mp, ok := hdlr.handlers.Search(http.MethodPost, "/"+microMethod) - if ok { + fh, mp, err := hdlr.handlers.Search(http.MethodPost, "/"+microMethod) + if err == nil { match = true for k, v := range mp { matches[k] = v @@ -216,7 +218,7 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { // define the handler func fn := func(fctx context.Context, req server.Request, rsp interface{}) (err error) { - returnValues = function.Call([]reflect.Value{hldr.rcvr, hldr.mtype.prepareContext(fctx), reflect.ValueOf(argv.Interface()), reflect.ValueOf(rsp)}) + returnValues = function.Call([]reflect.Value{hldr.rcvr, hldr.mtype.prepareContext(fctx), argv, reflect.ValueOf(rsp)}) // The return value for the method is an error. if rerr := returnValues[0].Interface(); rerr != nil { -- 2.45.2 From 25469792df71b8fa25b0524c0f0f1d03b7f9544d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jan 2023 17:06:34 +0000 Subject: [PATCH 26/49] Bump go.unistack.org/micro/v3 from 3.9.18 to 3.10.0 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.18 to 3.10.0. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.9.18...v3.10.0) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d25b367..eafeb25 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.9.18 + go.unistack.org/micro/v3 v3.10.0 golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 0d399d1..ef9858c 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= -go.unistack.org/micro/v3 v3.9.18 h1:FNsCCJJKyyP9gScc1K3HxGxFjub+c4ZQpL+QwVvIMro= -go.unistack.org/micro/v3 v3.9.18/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= +go.unistack.org/micro/v3 v3.10.0 h1:nPtk5Pfwk524HyezGtQ3m3vbK4LdvXqWLI7HgeilYOk= +go.unistack.org/micro/v3 v3.10.0/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= -- 2.45.2 From db5e66e3754cc109cc9f337517c7430d8de7c640 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Jan 2023 17:03:51 +0000 Subject: [PATCH 27/49] Bump go.unistack.org/micro/v3 from 3.10.0 to 3.10.1 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.0 to 3.10.1. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.10.0...v3.10.1) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index eafeb25..77c4758 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.10.0 + go.unistack.org/micro/v3 v3.10.1 golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index ef9858c..f840996 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= -go.unistack.org/micro/v3 v3.10.0 h1:nPtk5Pfwk524HyezGtQ3m3vbK4LdvXqWLI7HgeilYOk= -go.unistack.org/micro/v3 v3.10.0/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= +go.unistack.org/micro/v3 v3.10.1 h1:MbtPj7ueTw4x6lL2Ok2ez70ORyGXBWhxizO5fQsnAA4= +go.unistack.org/micro/v3 v3.10.1/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= -- 2.45.2 From 5ba77426197bc5928c6e86e391897da0d8e59879 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 17 Jan 2023 23:40:24 +0300 Subject: [PATCH 28/49] fix endpoint Signed-off-by: Vasiliy Tolstov --- handler.go | 1 + 1 file changed, 1 insertion(+) diff --git a/handler.go b/handler.go index 426e979..abdf6f2 100644 --- a/handler.go +++ b/handler.go @@ -212,6 +212,7 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { service: handler.sopts.Name, contentType: ct, method: fmt.Sprintf("%s.%s", hldr.name, hldr.mtype.method.Name), + endpoint: fmt.Sprintf("%s.%s", hldr.name, hldr.mtype.method.Name), payload: argv.Interface(), header: md, } -- 2.45.2 From 8e607dcc26970e7303a78c2bb2c3d0b1ba76a656 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Jan 2023 17:03:05 +0000 Subject: [PATCH 29/49] Bump go.unistack.org/micro/v3 from 3.10.1 to 3.10.4 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.1 to 3.10.4. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.10.1...v3.10.4) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 77c4758..3718da8 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.10.1 + go.unistack.org/micro/v3 v3.10.4 golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f840996..d3b969d 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= -go.unistack.org/micro/v3 v3.10.1 h1:MbtPj7ueTw4x6lL2Ok2ez70ORyGXBWhxizO5fQsnAA4= -go.unistack.org/micro/v3 v3.10.1/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= +go.unistack.org/micro/v3 v3.10.4 h1:8HneC2t7oteTwwkFLmSg5bs62h/OqEzevx/IbXG1vRo= +go.unistack.org/micro/v3 v3.10.4/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= -- 2.45.2 From 7c15ee784a10dcc781278704d346e7cde3dd5dff Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 23 Jan 2023 09:23:38 +0300 Subject: [PATCH 30/49] fix error handler Signed-off-by: Vasiliy Tolstov --- http.go | 6 +++++- options.go | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/http.go b/http.go index 84c8678..887a660 100644 --- a/http.go +++ b/http.go @@ -602,11 +602,15 @@ func (h *httpServer) Name() string { func NewServer(opts ...server.Option) *httpServer { options := server.NewOptions(opts...) + eh := DefaultErrorHandler + if v, ok := options.Context.Value(errorHandlerKey{}).(errorHandler); ok && v != nil { + eh = v + } return &httpServer{ opts: options, exit: make(chan chan error), subscribers: make(map[*httpSubscriber][]broker.Subscriber), - errorHandler: DefaultErrorHandler, + errorHandler: eh, pathHandlers: rhttp.NewTrie(), } } diff --git a/options.go b/options.go index 7a2903d..32fdc7b 100644 --- a/options.go +++ b/options.go @@ -68,10 +68,12 @@ func Server(hs *http.Server) server.Option { return server.SetOption(serverKey{}, hs) } +type errorHandler func(ctx context.Context, s server.Handler, w http.ResponseWriter, r *http.Request, err error, status int) + type errorHandlerKey struct{} // ErrorHandler specifies handler for errors -func ErrorHandler(fn func(ctx context.Context, s server.Handler, w http.ResponseWriter, r *http.Request, err error, status int)) server.Option { +func ErrorHandler(fn errorHandler) server.Option { return server.SetOption(errorHandlerKey{}, fn) } -- 2.45.2 From c37d057669da9c6f354466567f52102d8f031b8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Jan 2023 09:54:56 +0300 Subject: [PATCH 31/49] Bump golangci/golangci-lint-action from 3.3.1 to 3.4.0 (#134) Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.3.1 to 3.4.0. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v3.3.1...v3.4.0) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- .github/workflows/pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 66e730f..9603352 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: - name: checkout uses: actions/checkout@v3 - name: lint - uses: golangci/golangci-lint-action@v3.3.1 + uses: golangci/golangci-lint-action@v3.4.0 continue-on-error: true with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 14c16ea..f313ebe 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -34,7 +34,7 @@ jobs: - name: checkout uses: actions/checkout@v3 - name: lint - uses: golangci/golangci-lint-action@v3.3.1 + uses: golangci/golangci-lint-action@v3.4.0 continue-on-error: true with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. -- 2.45.2 From 14ff546fc1ab7fbe1faec10dab685d848e57d691 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 17:06:09 +0000 Subject: [PATCH 32/49] Bump go.unistack.org/micro/v3 from 3.10.4 to 3.10.5 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.4 to 3.10.5. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.10.4...v3.10.5) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3718da8..9f96150 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.10.4 + go.unistack.org/micro/v3 v3.10.5 golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index d3b969d..c2ae330 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= -go.unistack.org/micro/v3 v3.10.4 h1:8HneC2t7oteTwwkFLmSg5bs62h/OqEzevx/IbXG1vRo= -go.unistack.org/micro/v3 v3.10.4/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= +go.unistack.org/micro/v3 v3.10.5 h1:m71XxBa3eOK83bBof0qGU1Fkfo0zYY7gXrtjdE7S6U4= +go.unistack.org/micro/v3 v3.10.5/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= -- 2.45.2 From a8d47d0c1c1b1f6a44903d612fb6b4a2105c48b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 21:21:45 +0300 Subject: [PATCH 33/49] Bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 (#135) Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.5 to 1.3.6. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.5...v1.3.6) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependabot-automerge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml index b8e71a1..f41c1c0 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/dependabot-automerge.yml @@ -15,7 +15,7 @@ jobs: steps: - name: metadata id: metadata - uses: dependabot/fetch-metadata@v1.3.5 + uses: dependabot/fetch-metadata@v1.3.6 with: github-token: "${{ secrets.TOKEN }}" - name: merge -- 2.45.2 From b5148e90cb92bf1a3a449bc3117be2d8af67d90a Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sun, 5 Feb 2023 11:29:51 +0300 Subject: [PATCH 34/49] return after errorHandler Signed-off-by: Vasiliy Tolstov --- handler.go | 1 + 1 file changed, 1 insertion(+) diff --git a/handler.go b/handler.go index abdf6f2..bfe8e1d 100644 --- a/handler.go +++ b/handler.go @@ -117,6 +117,7 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { break } else if err == rhttp.ErrMethodNotAllowed && !h.registerRPC { h.errorHandler(ctx, nil, w, r, fmt.Errorf("not matching route found"), http.StatusNotFound) + return } } -- 2.45.2 From d0fee2ca23126815a69d7b5738f9bd31d6a63211 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Feb 2023 17:03:59 +0000 Subject: [PATCH 35/49] Bump go.unistack.org/micro/v3 from 3.10.5 to 3.10.6 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.5 to 3.10.6. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.10.5...v3.10.6) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9f96150..cac2acd 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.10.5 + go.unistack.org/micro/v3 v3.10.6 golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index c2ae330..efe262e 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= -go.unistack.org/micro/v3 v3.10.5 h1:m71XxBa3eOK83bBof0qGU1Fkfo0zYY7gXrtjdE7S6U4= -go.unistack.org/micro/v3 v3.10.5/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= +go.unistack.org/micro/v3 v3.10.6 h1:h8ZrcIm58DfnLncB/NgmOHM+Ls8cE9qthxbWJ+gWzl4= +go.unistack.org/micro/v3 v3.10.6/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= -- 2.45.2 From b16e6ebd3135cb9dfdf71d930c623224c58a7738 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Feb 2023 17:02:19 +0000 Subject: [PATCH 36/49] Bump go.unistack.org/micro/v3 from 3.10.6 to 3.10.8 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.6 to 3.10.8. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.10.6...v3.10.8) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index cac2acd..c1cf358 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.10.6 + go.unistack.org/micro/v3 v3.10.8 golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index efe262e..e872b73 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= -go.unistack.org/micro/v3 v3.10.6 h1:h8ZrcIm58DfnLncB/NgmOHM+Ls8cE9qthxbWJ+gWzl4= -go.unistack.org/micro/v3 v3.10.6/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= +go.unistack.org/micro/v3 v3.10.8 h1:vl8fHYgWp6WadvVy4LtJ8lc3e8Y0VrfBOU5EorZ3PIA= +go.unistack.org/micro/v3 v3.10.8/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= -- 2.45.2 From 2ff786cb033b27cba03327ef7c9c34ed95bc4d95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Feb 2023 17:03:00 +0000 Subject: [PATCH 37/49] Bump go.unistack.org/micro/v3 from 3.10.8 to 3.10.9 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.8 to 3.10.9. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.10.8...v3.10.9) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c1cf358..f1a8535 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.10.8 + go.unistack.org/micro/v3 v3.10.9 golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index e872b73..0c33940 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= -go.unistack.org/micro/v3 v3.10.8 h1:vl8fHYgWp6WadvVy4LtJ8lc3e8Y0VrfBOU5EorZ3PIA= -go.unistack.org/micro/v3 v3.10.8/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= +go.unistack.org/micro/v3 v3.10.9 h1:o8gdlE5JC9b2sm89RmztQPHnP4thN6FkGZyrKrahxX8= +go.unistack.org/micro/v3 v3.10.9/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= -- 2.45.2 From 82beddb09bd8a09ace04f09dc28e496046032840 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sat, 11 Feb 2023 01:18:16 +0300 Subject: [PATCH 38/49] add http header option (#142) * add http header option --- handler.go | 8 ++++++++ options.go | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/handler.go b/handler.go index bfe8e1d..6043365 100644 --- a/handler.go +++ b/handler.go @@ -73,6 +73,7 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { } ctx := context.WithValue(r.Context(), rspCodeKey{}, &rspCodeVal{}) + ctx = context.WithValue(ctx, rspHeaderKey{}, &rspHeaderVal{}) md, ok := metadata.FromIncomingContext(ctx) if !ok { md = metadata.New(len(r.Header) + 8) @@ -264,6 +265,13 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { w.Header().Set(k, v) } } + if md := getRspHeader(ctx); md != nil { + for k, v := range md { + for _, vv := range v { + w.Header().Add(k, vv) + } + } + } if nct := w.Header().Get(metadata.HeaderContentType); nct != ct { if cf, err = h.newCodec(nct); err != nil { h.errorHandler(ctx, nil, w, r, err, http.StatusBadRequest) diff --git a/options.go b/options.go index 32fdc7b..2c06b0c 100644 --- a/options.go +++ b/options.go @@ -38,6 +38,20 @@ type ( } ) +type ( + rspHeaderKey struct{} + rspHeaderVal struct { + h http.Header + } +) + +// SetRspHeader add response headers +func SetRspHeader(ctx context.Context, h http.Header) { + if rsp, ok := ctx.Value(rspHeaderKey{}).(*rspHeaderVal); ok { + rsp.h = h + } +} + // SetRspCode saves response code in context, must be used by handler to specify http code func SetRspCode(ctx context.Context, code int) { if rsp, ok := ctx.Value(rspCodeKey{}).(*rspCodeVal); ok { @@ -45,6 +59,14 @@ func SetRspCode(ctx context.Context, code int) { } } +// getRspHeader get http.Header from context +func getRspHeader(ctx context.Context) http.Header { + if rsp, ok := ctx.Value(rspHeaderKey{}).(*rspHeaderVal); ok { + return rsp.h + } + return nil +} + // GetRspCode used internally by generated http server handler func GetRspCode(ctx context.Context) int { var code int -- 2.45.2 From 02f9d6d8f75ab6b79ed7b7b91ecd25f02a5fd95e Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 13 Feb 2023 00:09:54 +0300 Subject: [PATCH 39/49] dont mangle header names Signed-off-by: Vasiliy Tolstov --- handler.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/handler.go b/handler.go index 6043365..5b2c0dc 100644 --- a/handler.go +++ b/handler.go @@ -79,16 +79,16 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { md = metadata.New(len(r.Header) + 8) } for k, v := range r.Header { - md.Set(k, strings.Join(v, ", ")) + md[k] = strings.Join(v, ", ") } - md.Set("RemoteAddr", r.RemoteAddr) - md.Set("Method", r.Method) - md.Set("URL", r.URL.String()) - md.Set("Proto", r.Proto) - md.Set("ContentLength", fmt.Sprintf("%d", r.ContentLength)) - md.Set("TransferEncoding", strings.Join(r.TransferEncoding, ",")) - md.Set("Host", r.Host) - md.Set("RequestURI", r.RequestURI) + md["RemoteAddr"] = r.RemoteAddr + md["Method"] = r.Method + md["URL"] = r.URL.String() + md["Proto"] = r.Proto + md["ContentLength"] = fmt.Sprintf("%d", r.ContentLength) + md["TransferEncoding"] = strings.Join(r.TransferEncoding, ",") + md["Host"] = r.Host + md["RequestURI"] = r.RequestURI ctx = metadata.NewIncomingContext(ctx, md) defer r.Body.Close() -- 2.45.2 From dbc3c12eed4e89974d128eb4f349a665bbcd91d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Feb 2023 18:01:59 +0000 Subject: [PATCH 40/49] Bump go.unistack.org/micro/v3 from 3.10.9 to 3.10.10 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.9 to 3.10.10. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.10.9...v3.10.10) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f1a8535..0a84b2e 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.10.9 + go.unistack.org/micro/v3 v3.10.10 golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 0c33940..cb56632 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= -go.unistack.org/micro/v3 v3.10.9 h1:o8gdlE5JC9b2sm89RmztQPHnP4thN6FkGZyrKrahxX8= -go.unistack.org/micro/v3 v3.10.9/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= +go.unistack.org/micro/v3 v3.10.10 h1:FMHMnQD4Hk9tc+kHZHzYlUjv49k0WZOOCCVFLVGTYwY= +go.unistack.org/micro/v3 v3.10.10/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= -- 2.45.2 From c27a8b7cf870d0276c77e4eaeb39a265be47a3a9 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 13 Feb 2023 23:36:50 +0300 Subject: [PATCH 41/49] add HandlerMetadata server.HandlerOption Signed-off-by: Vasiliy Tolstov --- go.mod | 2 +- go.sum | 4 ++-- options.go | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 0a84b2e..c66c92d 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.10.10 + go.unistack.org/micro/v3 v3.10.11 golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index cb56632..69d32bb 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= -go.unistack.org/micro/v3 v3.10.10 h1:FMHMnQD4Hk9tc+kHZHzYlUjv49k0WZOOCCVFLVGTYwY= -go.unistack.org/micro/v3 v3.10.10/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= +go.unistack.org/micro/v3 v3.10.11 h1:IPUEVQ5oGZ6Ft2/2zQAOIkp+Ztt6GIHxwMoG4l+eJGQ= +go.unistack.org/micro/v3 v3.10.11/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= diff --git a/options.go b/options.go index 2c06b0c..0fcba72 100644 --- a/options.go +++ b/options.go @@ -133,6 +133,12 @@ func RegisterRPCHandler(b bool) server.Option { return server.SetOption(registerRPCHandlerKey{}, b) } +type handlerMetadataKey struct{} + +func HandlerMetadata(md map[string]map[string]string) server.HandlerOption { + return server.SetHandlerOption(handlerMetadataKey{}, md) +} + type headerKey struct{} type handlerOptions struct { -- 2.45.2 From e8281da860b6335f0fb1df2191ea0ce6970a8a2e Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 21 Feb 2023 17:14:50 +0300 Subject: [PATCH 42/49] change metadata type Signed-off-by: Vasiliy Tolstov --- options.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/options.go b/options.go index 0fcba72..5a56e41 100644 --- a/options.go +++ b/options.go @@ -135,12 +135,10 @@ func RegisterRPCHandler(b bool) server.Option { type handlerMetadataKey struct{} -func HandlerMetadata(md map[string]map[string]string) server.HandlerOption { +func HandlerMetadata(md map[string]map[string]map[string]string) server.HandlerOption { return server.SetHandlerOption(handlerMetadataKey{}, md) } -type headerKey struct{} - type handlerOptions struct { headers []string cookies []string -- 2.45.2 From d3fc61eada1e811b565acb6a27e3e124b266baf0 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 21 Feb 2023 17:15:22 +0300 Subject: [PATCH 43/49] change metadata type Signed-off-by: Vasiliy Tolstov --- go.mod | 4 ++-- go.sum | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index c66c92d..a272f32 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.10.11 - golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e + go.unistack.org/micro/v3 v3.10.12 + golang.org/x/net v0.7.0 gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 69d32bb..46f708e 100644 --- a/go.sum +++ b/go.sum @@ -71,34 +71,45 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= go.unistack.org/micro/v3 v3.10.11 h1:IPUEVQ5oGZ6Ft2/2zQAOIkp+Ztt6GIHxwMoG4l+eJGQ= go.unistack.org/micro/v3 v3.10.11/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= +go.unistack.org/micro/v3 v3.10.12 h1:M/aRNkj3FFWFivsHnm1XT4qjc9xiGxSl15BStW1SgQ4= +go.unistack.org/micro/v3 v3.10.12/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 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-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= 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-20190108225652-1e06a53dbb7e/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-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 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= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/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-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/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= @@ -109,18 +120,25 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/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-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 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/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= 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-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -- 2.45.2 From eea8ae605b6d194bbd05af9a4cd7ecc35a899a00 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 21 Feb 2023 23:56:07 +0300 Subject: [PATCH 44/49] provide HandlerEndpoints Signed-off-by: Vasiliy Tolstov --- http.go | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ options.go | 14 +++++++++++--- 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/http.go b/http.go index 887a660..d23d01d 100644 --- a/http.go +++ b/http.go @@ -235,6 +235,56 @@ func (h *httpServer) NewHandler(handler interface{}, opts ...server.HandlerOptio } } + metadata, ok := options.Context.Value(handlerEndpointsKey{}).([]EndpointMetadata) + if !ok { + return hdlr + } + + for _, md := range metadata { + hn := md.Name + var method reflect.Method + mname := hn[strings.Index(hn, ".")+1:] + for m := 0; m < tp.NumMethod(); m++ { + mn := tp.Method(m) + if mn.Name != mname { + continue + } + method = mn + break + } + + if method.Name == "" && h.opts.Logger.V(logger.ErrorLevel) { + h.opts.Logger.Errorf(h.opts.Context, "nil method for %s", mname) + continue + } + + mtype, err := prepareEndpoint(method) + if err != nil && h.opts.Logger.V(logger.ErrorLevel) { + h.opts.Logger.Errorf(h.opts.Context, "%v", err) + continue + } else if mtype == nil { + h.opts.Logger.Errorf(h.opts.Context, "nil mtype for %s", mname) + continue + } + + rcvr := reflect.ValueOf(handler) + name := reflect.Indirect(rcvr).Type().Name() + + pth := &patHandler{mtype: mtype, name: name, rcvr: rcvr} + hdlr.name = name + + if err := hdlr.handlers.Insert([]string{md.Method}, md.Path, pth); err != nil { + h.opts.Logger.Errorf(h.opts.Context, "cant add handler for %s %s", md.Method, md.Path) + } + + if h.registerRPC { + h.opts.Logger.Infof(h.opts.Context, "register rpc handler for http.MethodPost %s /%s", hn, hn) + if err := hdlr.handlers.Insert([]string{http.MethodPost}, "/"+hn, pth); err != nil { + h.opts.Logger.Errorf(h.opts.Context, "cant add rpc handler for http.MethodPost %s /%s", hn, hn) + } + } + } + return hdlr } diff --git a/options.go b/options.go index 5a56e41..3825d11 100644 --- a/options.go +++ b/options.go @@ -133,10 +133,18 @@ func RegisterRPCHandler(b bool) server.Option { return server.SetOption(registerRPCHandlerKey{}, b) } -type handlerMetadataKey struct{} +type handlerEndpointsKey struct{} -func HandlerMetadata(md map[string]map[string]map[string]string) server.HandlerOption { - return server.SetHandlerOption(handlerMetadataKey{}, md) +type EndpointMetadata struct { + Name string + Path string + Method string + Body string + Stream bool +} + +func HandlerEndpoints(md []EndpointMetadata) server.HandlerOption { + return server.SetHandlerOption(handlerEndpointsKey{}, md) } type handlerOptions struct { -- 2.45.2 From e67021895e972f50f3d75dc74dcc62d0da0e71ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Feb 2023 17:14:50 +0000 Subject: [PATCH 45/49] Bump go.unistack.org/micro/v3 from 3.10.12 to 3.10.13 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.12 to 3.10.13. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.10.12...v3.10.13) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index a272f32..b462c1c 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.10.12 + go.unistack.org/micro/v3 v3.10.13 golang.org/x/net v0.7.0 gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 46f708e..3fe3a8b 100644 --- a/go.sum +++ b/go.sum @@ -75,10 +75,8 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= -go.unistack.org/micro/v3 v3.10.11 h1:IPUEVQ5oGZ6Ft2/2zQAOIkp+Ztt6GIHxwMoG4l+eJGQ= -go.unistack.org/micro/v3 v3.10.11/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= -go.unistack.org/micro/v3 v3.10.12 h1:M/aRNkj3FFWFivsHnm1XT4qjc9xiGxSl15BStW1SgQ4= -go.unistack.org/micro/v3 v3.10.12/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= +go.unistack.org/micro/v3 v3.10.13 h1:GtQwCXvOw3ywwgNKRPE/NA7hNoHnVIvFElDjjfy5Xtc= +go.unistack.org/micro/v3 v3.10.13/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -98,8 +96,6 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -- 2.45.2 From c908274c8b0019ec959e26c50b70927bb96bbd21 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sun, 26 Feb 2023 14:51:34 +0300 Subject: [PATCH 46/49] import from main repo Signed-off-by: Vasiliy Tolstov --- go.mod | 1 + go.sum | 4 -- handler/health/generate.go | 8 +++ handler/health/health.go | 82 ++++++++++++++++++++++++++ handler/health/health.proto | 50 ++++++++++++++++ handler/health/health_micro.pb.go | 48 +++++++++++++++ handler/health/health_micro_http.pb.go | 43 ++++++++++++++ handler/meter/generate.go | 8 +++ handler/meter/meter.go | 67 +++++++++++++++++++++ handler/meter/meter.proto | 24 ++++++++ handler/meter/meter_micro.pb.go | 32 ++++++++++ handler/meter/meter_micro_http.pb.go | 33 +++++++++++ 12 files changed, 396 insertions(+), 4 deletions(-) create mode 100644 handler/health/generate.go create mode 100644 handler/health/health.go create mode 100644 handler/health/health.proto create mode 100644 handler/health/health_micro.pb.go create mode 100644 handler/health/health_micro_http.pb.go create mode 100644 handler/meter/generate.go create mode 100644 handler/meter/meter.go create mode 100644 handler/meter/meter.proto create mode 100644 handler/meter/meter_micro.pb.go create mode 100644 handler/meter/meter_micro_http.pb.go diff --git a/go.mod b/go.mod index a272f32..1dc03da 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module go.unistack.org/micro-server-http/v3 go 1.16 require ( + go.unistack.org/micro-proto/v3 v3.3.1 go.unistack.org/micro/v3 v3.10.12 golang.org/x/net v0.7.0 gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 46f708e..b2c7fad 100644 --- a/go.sum +++ b/go.sum @@ -75,8 +75,6 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= -go.unistack.org/micro/v3 v3.10.11 h1:IPUEVQ5oGZ6Ft2/2zQAOIkp+Ztt6GIHxwMoG4l+eJGQ= -go.unistack.org/micro/v3 v3.10.11/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= go.unistack.org/micro/v3 v3.10.12 h1:M/aRNkj3FFWFivsHnm1XT4qjc9xiGxSl15BStW1SgQ4= go.unistack.org/micro/v3 v3.10.12/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -98,8 +96,6 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= diff --git a/handler/health/generate.go b/handler/health/generate.go new file mode 100644 index 0000000..c783863 --- /dev/null +++ b/handler/health/generate.go @@ -0,0 +1,8 @@ +package health + +//go:generate sh -c "protoc -I./ -I$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v3) --go-micro_out='components=micro|http|server',standalone=false,debug=true,paths=source_relative:./ health.proto" + +import ( + // import required packages + _ "go.unistack.org/micro-proto/v3/openapiv3" +) diff --git a/handler/health/health.go b/handler/health/health.go new file mode 100644 index 0000000..4399cf3 --- /dev/null +++ b/handler/health/health.go @@ -0,0 +1,82 @@ +package health // import "go.unistack.org/micro-server-http/v3/handler/health" + +import ( + "context" + + codecpb "go.unistack.org/micro-proto/v3/codec" + "go.unistack.org/micro/v3/errors" +) + +var _ HealthServiceServer = &Handler{} + +type Handler struct { + opts Options +} + +type CheckFunc func(context.Context) error + +type Option func(*Options) + +type Options struct { + Version string + Name string + LiveChecks []CheckFunc + ReadyChecks []CheckFunc +} + +func LiveChecks(fns ...CheckFunc) Option { + return func(o *Options) { + o.LiveChecks = append(o.LiveChecks, fns...) + } +} + +func ReadyChecks(fns ...CheckFunc) Option { + return func(o *Options) { + o.ReadyChecks = append(o.ReadyChecks, fns...) + } +} + +func Name(name string) Option { + return func(o *Options) { + o.Name = name + } +} + +func Version(version string) Option { + return func(o *Options) { + o.Version = version + } +} + +func NewHandler(opts ...Option) *Handler { + options := Options{} + for _, o := range opts { + o(&options) + } + return &Handler{opts: options} +} + +func (h *Handler) Live(ctx context.Context, req *codecpb.Frame, rsp *codecpb.Frame) error { + var err error + for _, fn := range h.opts.LiveChecks { + if err = fn(ctx); err != nil { + return errors.ServiceUnavailable(h.opts.Name, "%v", err) + } + } + return nil +} + +func (h *Handler) Ready(ctx context.Context, req *codecpb.Frame, rsp *codecpb.Frame) error { + var err error + for _, fn := range h.opts.ReadyChecks { + if err = fn(ctx); err != nil { + return errors.ServiceUnavailable(h.opts.Name, "%v", err) + } + } + return nil +} + +func (h *Handler) Version(ctx context.Context, req *codecpb.Frame, rsp *codecpb.Frame) error { + rsp.Data = []byte(h.opts.Version) + return nil +} diff --git a/handler/health/health.proto b/handler/health/health.proto new file mode 100644 index 0000000..1795501 --- /dev/null +++ b/handler/health/health.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; + +package micro.server.http.v3.handler.health; +option go_package = "go.unistack.org/micro-server-http/v3/handler/health;health"; + +import "api/annotations.proto"; +import "openapiv3/annotations.proto"; +import "codec/frame.proto"; + +service HealthService { + rpc Live(micro.codec.Frame) returns (micro.codec.Frame) { + option (micro.openapiv3.openapiv3_operation) = { + operation_id: "Live"; + responses: { + default: { + reference: { + _ref: "micro.codec.Frame"; + }; + }; + }; + }; + option (micro.api.http) = { get: "/live"; }; + }; + rpc Ready(micro.codec.Frame) returns (micro.codec.Frame) { + option (micro.openapiv3.openapiv3_operation) = { + operation_id: "Ready"; + responses: { + default: { + reference: { + _ref: "micro.codec.Frame"; + }; + }; + }; + }; + option (micro.api.http) = { get: "/ready"; }; + }; + rpc Version(micro.codec.Frame) returns (micro.codec.Frame) { + option (micro.openapiv3.openapiv3_operation) = { + operation_id: "Version"; + responses: { + default: { + reference: { + _ref: "micro.codec.Frame"; + }; + }; + }; + }; + option (micro.api.http) = { get: "/version"; }; + }; +}; diff --git a/handler/health/health_micro.pb.go b/handler/health/health_micro.pb.go new file mode 100644 index 0000000..3e6f6a0 --- /dev/null +++ b/handler/health/health_micro.pb.go @@ -0,0 +1,48 @@ +// Code generated by protoc-gen-go-micro. DO NOT EDIT. +// versions: +// - protoc-gen-go-micro v3.10.2 +// - protoc v3.21.12 +// source: health.proto + +package health + +import ( + context "context" + codec "go.unistack.org/micro-proto/v3/codec" + v3 "go.unistack.org/micro-server-http/v3" +) + +var ( + HealthServiceName = "HealthService" +) +var ( + HealthServiceServerEndpoints = []v3.EndpointMetadata{ + { + Name: "HealthService.Live", + Path: "/live", + Method: "GET", + Body: "", + Stream: false, + }, + { + Name: "HealthService.Ready", + Path: "/ready", + Method: "GET", + Body: "", + Stream: false, + }, + { + Name: "HealthService.Version", + Path: "/version", + Method: "GET", + Body: "", + Stream: false, + }, + } +) + +type HealthServiceServer interface { + Live(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error + Ready(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error + Version(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error +} diff --git a/handler/health/health_micro_http.pb.go b/handler/health/health_micro_http.pb.go new file mode 100644 index 0000000..0e3c6e7 --- /dev/null +++ b/handler/health/health_micro_http.pb.go @@ -0,0 +1,43 @@ +// Code generated by protoc-gen-go-micro. DO NOT EDIT. +// protoc-gen-go-micro version: v3.10.2 +// source: health.proto + +package health + +import ( + context "context" + codec "go.unistack.org/micro-proto/v3/codec" + v3 "go.unistack.org/micro-server-http/v3" + server "go.unistack.org/micro/v3/server" +) + +type healthServiceServer struct { + HealthServiceServer +} + +func (h *healthServiceServer) Live(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error { + return h.HealthServiceServer.Live(ctx, req, rsp) +} + +func (h *healthServiceServer) Ready(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error { + return h.HealthServiceServer.Ready(ctx, req, rsp) +} + +func (h *healthServiceServer) Version(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error { + return h.HealthServiceServer.Version(ctx, req, rsp) +} + +func RegisterHealthServiceServer(s server.Server, sh HealthServiceServer, opts ...server.HandlerOption) error { + type healthService interface { + Live(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error + Ready(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error + Version(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error + } + type HealthService struct { + healthService + } + h := &healthServiceServer{sh} + var nopts []server.HandlerOption + nopts = append(nopts, v3.HandlerEndpoints(HealthServiceServerEndpoints)) + return s.Handle(s.NewHandler(&HealthService{h}, append(nopts, opts...)...)) +} diff --git a/handler/meter/generate.go b/handler/meter/generate.go new file mode 100644 index 0000000..1605764 --- /dev/null +++ b/handler/meter/generate.go @@ -0,0 +1,8 @@ +package meter + +//go:generate sh -c "protoc -I./ -I$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v3) --go-micro_out='components=micro|http|server',standalone=false,debug=true,paths=source_relative:./ meter.proto" + +import ( + // import required packages + _ "go.unistack.org/micro-proto/v3/openapiv3" +) diff --git a/handler/meter/meter.go b/handler/meter/meter.go new file mode 100644 index 0000000..f92830e --- /dev/null +++ b/handler/meter/meter.go @@ -0,0 +1,67 @@ +package meter // import "go.unistack.org/micro-server-http/v3/handler/meter" + +import ( + "bytes" + "context" + + codecpb "go.unistack.org/micro-proto/v3/codec" + "go.unistack.org/micro/v3/errors" + "go.unistack.org/micro/v3/meter" +) + +// guard to fail early +var _ MeterServiceServer = &Handler{} + +type Handler struct { + opts Options +} + +type Option func(*Options) + +type Options struct { + Meter meter.Meter + Name string + MeterOptions []meter.Option +} + +func Meter(m meter.Meter) Option { + return func(o *Options) { + o.Meter = m + } +} + +func Name(name string) Option { + return func(o *Options) { + o.Name = name + } +} + +func MeterOptions(opts ...meter.Option) Option { + return func(o *Options) { + o.MeterOptions = append(o.MeterOptions, opts...) + } +} + +func NewOptions(opts ...Option) Options { + options := Options{Meter: meter.DefaultMeter} + for _, o := range opts { + o(&options) + } + return options +} + +func NewHandler(opts ...Option) *Handler { + options := NewOptions(opts...) + return &Handler{opts: options} +} + +func (h *Handler) Metrics(ctx context.Context, req *codecpb.Frame, rsp *codecpb.Frame) error { + buf := bytes.NewBuffer(nil) + if err := h.opts.Meter.Write(buf, h.opts.MeterOptions...); err != nil { + return errors.InternalServerError(h.opts.Name, "%v", err) + } + + rsp.Data = buf.Bytes() + + return nil +} diff --git a/handler/meter/meter.proto b/handler/meter/meter.proto new file mode 100644 index 0000000..7fc653e --- /dev/null +++ b/handler/meter/meter.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package micro.server.http.v3.handler.meter; +option go_package = "go.unistack.org/micro-server-http/v3/handler/meter;meter"; + +import "api/annotations.proto"; +import "openapiv3/annotations.proto"; +import "codec/frame.proto"; + +service MeterService { + rpc Metrics(micro.codec.Frame) returns (micro.codec.Frame) { + option (micro.openapiv3.openapiv3_operation) = { + operation_id: "Metrics"; + responses: { + default: { + reference: { + _ref: "micro.codec.Frame"; + }; + }; + }; + }; + option (micro.api.http) = { get: "/metrics"; }; + }; +}; diff --git a/handler/meter/meter_micro.pb.go b/handler/meter/meter_micro.pb.go new file mode 100644 index 0000000..d9ba8aa --- /dev/null +++ b/handler/meter/meter_micro.pb.go @@ -0,0 +1,32 @@ +// Code generated by protoc-gen-go-micro. DO NOT EDIT. +// versions: +// - protoc-gen-go-micro v3.10.2 +// - protoc v3.21.12 +// source: meter.proto + +package meter + +import ( + context "context" + codec "go.unistack.org/micro-proto/v3/codec" + v3 "go.unistack.org/micro-server-http/v3" +) + +var ( + MeterServiceName = "MeterService" +) +var ( + MeterServiceServerEndpoints = []v3.EndpointMetadata{ + { + Name: "MeterService.Metrics", + Path: "/metrics", + Method: "GET", + Body: "", + Stream: false, + }, + } +) + +type MeterServiceServer interface { + Metrics(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error +} diff --git a/handler/meter/meter_micro_http.pb.go b/handler/meter/meter_micro_http.pb.go new file mode 100644 index 0000000..e79500a --- /dev/null +++ b/handler/meter/meter_micro_http.pb.go @@ -0,0 +1,33 @@ +// Code generated by protoc-gen-go-micro. DO NOT EDIT. +// protoc-gen-go-micro version: v3.10.2 +// source: meter.proto + +package meter + +import ( + context "context" + codec "go.unistack.org/micro-proto/v3/codec" + v3 "go.unistack.org/micro-server-http/v3" + server "go.unistack.org/micro/v3/server" +) + +type meterServiceServer struct { + MeterServiceServer +} + +func (h *meterServiceServer) Metrics(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error { + return h.MeterServiceServer.Metrics(ctx, req, rsp) +} + +func RegisterMeterServiceServer(s server.Server, sh MeterServiceServer, opts ...server.HandlerOption) error { + type meterService interface { + Metrics(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error + } + type MeterService struct { + meterService + } + h := &meterServiceServer{sh} + var nopts []server.HandlerOption + nopts = append(nopts, v3.HandlerEndpoints(MeterServiceServerEndpoints)) + return s.Handle(s.NewHandler(&MeterService{h}, append(nopts, opts...)...)) +} -- 2.45.2 From dad2d8d5bd669d1ca7c990fb96f7135da28f5a42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 18:02:27 +0000 Subject: [PATCH 47/49] Bump go.unistack.org/micro/v3 from 3.10.13 to 3.10.14 Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.13 to 3.10.14. - [Release notes](https://github.com/unistack-org/micro/releases) - [Commits](https://github.com/unistack-org/micro/compare/v3.10.13...v3.10.14) --- updated-dependencies: - dependency-name: go.unistack.org/micro/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 9e05dab..f990118 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( go.unistack.org/micro-proto/v3 v3.3.1 - go.unistack.org/micro/v3 v3.10.13 + go.unistack.org/micro/v3 v3.10.14 golang.org/x/net v0.7.0 ) diff --git a/go.sum b/go.sum index 0c4cb96..b089216 100644 --- a/go.sum +++ b/go.sum @@ -10,7 +10,6 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= @@ -45,19 +44,16 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -74,8 +70,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= -go.unistack.org/micro/v3 v3.10.13 h1:GtQwCXvOw3ywwgNKRPE/NA7hNoHnVIvFElDjjfy5Xtc= -go.unistack.org/micro/v3 v3.10.13/go.mod h1:gI4RkJKHLPW7KV6h4+ZBOZD997MRvFRXMPQIHpozikI= +go.unistack.org/micro/v3 v3.10.14 h1:7fgLpwGlCN67twhwtngJDEQvrMkUBDSA5vzZqxIDqNE= +go.unistack.org/micro/v3 v3.10.14/go.mod h1:uMAc0U/x7dmtICCrblGf0ZLgYegu3VwQAquu+OFCw1Q= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= -- 2.45.2 From 724ffb8c3a43f0fa8509a6cb30baec866152f0d9 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Thu, 9 Mar 2023 08:42:04 +0300 Subject: [PATCH 48/49] return method not allowed error Signed-off-by: Vasiliy Tolstov --- handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handler.go b/handler.go index 5b2c0dc..c50ac08 100644 --- a/handler.go +++ b/handler.go @@ -117,7 +117,7 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { handler = hdlr break } else if err == rhttp.ErrMethodNotAllowed && !h.registerRPC { - h.errorHandler(ctx, nil, w, r, fmt.Errorf("not matching route found"), http.StatusNotFound) + h.errorHandler(ctx, nil, w, r, fmt.Errorf("not matching route found"), http.StatusMethodNotAllowed) return } } -- 2.45.2 From 7f971ee6c3ad7da307bb13fdda4b03a917d3fda1 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Fri, 28 Apr 2023 21:59:31 +0300 Subject: [PATCH 49/49] move to micro v4 Signed-off-by: Vasiliy Tolstov --- README.md | 10 +++++----- go.mod | 8 ++++---- go.sum | 13 ++++--------- handler.go | 14 +++++++------- handler/health/generate.go | 4 ++-- handler/health/health.go | 6 +++--- handler/health/health.proto | 4 ++-- handler/health/health_micro.pb.go | 10 +++++----- handler/health/health_micro_http.pb.go | 10 +++++----- handler/meter/generate.go | 4 ++-- handler/meter/meter.go | 8 ++++---- handler/meter/meter.proto | 4 ++-- handler/meter/meter_micro.pb.go | 10 +++++----- handler/meter/meter_micro_http.pb.go | 10 +++++----- http.go | 14 +++++++------- message.go | 4 ++-- options.go | 2 +- request.go | 6 +++--- server.go | 2 +- subscriber.go | 10 +++++----- util.go | 4 ++-- util_test.go | 2 +- 22 files changed, 77 insertions(+), 82 deletions(-) diff --git a/README.md b/README.md index a32fab6..ddfc0b2 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ to create a HTTP Server that could potentially be used for REST based API servic import ( "net/http" - "github.com/unistack-org/micro/v3/server" - httpServer "github.com/unistack-org/micro-server-http" + "go.unistack.org/micro/v4/server" + httpServer "go.unistack.org/micro-server-http/v4" ) func main() { @@ -37,9 +37,9 @@ Or as part of a service import ( "net/http" - "github.com/unistack-org/micro/v3" - "github.com/unistack-org/micro/v3/server" - httpServer "github.com/unistack-org/micro-server-http" + "go.unistack.org/micro/v4" + "go.unistack.org/micro/v4/server" + httpServer "go.unistack.org/micro-server-http/v4" ) func main() { diff --git a/go.mod b/go.mod index f990118..f3c7063 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ -module go.unistack.org/micro-server-http/v3 +module go.unistack.org/micro-server-http/v4 -go 1.18 +go 1.19 require ( - go.unistack.org/micro-proto/v3 v3.3.1 - go.unistack.org/micro/v3 v3.10.14 + go.unistack.org/micro-proto/v4 v4.0.0 + go.unistack.org/micro/v4 v4.0.1 golang.org/x/net v0.7.0 ) diff --git a/go.sum b/go.sum index b089216..8e7c920 100644 --- a/go.sum +++ b/go.sum @@ -48,17 +48,14 @@ github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/silas/dag v0.0.0-20211117232152-9d50aa809f35/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -68,10 +65,10 @@ github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2 github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.unistack.org/micro-proto/v3 v3.3.1 h1:nQ0MtWvP2G3QrpOgawVOPhpZZYkq6umTGDqs8FxJYIo= -go.unistack.org/micro-proto/v3 v3.3.1/go.mod h1:cwRyv8uInM2I7EbU7O8Fx2Ls3N90Uw9UCCcq4olOdfE= -go.unistack.org/micro/v3 v3.10.14 h1:7fgLpwGlCN67twhwtngJDEQvrMkUBDSA5vzZqxIDqNE= -go.unistack.org/micro/v3 v3.10.14/go.mod h1:uMAc0U/x7dmtICCrblGf0ZLgYegu3VwQAquu+OFCw1Q= +go.unistack.org/micro-proto/v4 v4.0.0 h1:+TAwKSlx48eLsNO2E2cO0JLE8we1KU2AuWe9Q310FuU= +go.unistack.org/micro-proto/v4 v4.0.0/go.mod h1:ArmK7o+uFvxSY3dbJhKBBX4Pm1rhWdLEFf3LxBrMtec= +go.unistack.org/micro/v4 v4.0.1 h1:xo1IxbVfgh8i0eY0VeYa3cbb13u5n/Mxnp3FOgWD4Jo= +go.unistack.org/micro/v4 v4.0.1/go.mod h1:p/J5UcSJjfHsWGT31uKoghQ5rUQZzQJBAFy+Z4+ZVMs= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= @@ -150,8 +147,6 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/handler.go b/handler.go index c50ac08..a779aeb 100644 --- a/handler.go +++ b/handler.go @@ -9,13 +9,13 @@ import ( "strings" "sync" - "go.unistack.org/micro/v3/errors" - "go.unistack.org/micro/v3/logger" - "go.unistack.org/micro/v3/metadata" - "go.unistack.org/micro/v3/register" - "go.unistack.org/micro/v3/server" - rhttp "go.unistack.org/micro/v3/util/http" - rflutil "go.unistack.org/micro/v3/util/reflect" + "go.unistack.org/micro/v4/errors" + "go.unistack.org/micro/v4/logger" + "go.unistack.org/micro/v4/metadata" + "go.unistack.org/micro/v4/register" + "go.unistack.org/micro/v4/server" + rhttp "go.unistack.org/micro/v4/util/http" + rflutil "go.unistack.org/micro/v4/util/reflect" ) var ( diff --git a/handler/health/generate.go b/handler/health/generate.go index c783863..8df8f29 100644 --- a/handler/health/generate.go +++ b/handler/health/generate.go @@ -1,8 +1,8 @@ package health -//go:generate sh -c "protoc -I./ -I$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v3) --go-micro_out='components=micro|http|server',standalone=false,debug=true,paths=source_relative:./ health.proto" +//go:generate sh -c "protoc -I./ -I$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v4) --go-micro_out='components=micro|http|server',standalone=false,debug=true,paths=source_relative:./ health.proto" import ( // import required packages - _ "go.unistack.org/micro-proto/v3/openapiv3" + _ "go.unistack.org/micro-proto/v4/openapiv3" ) diff --git a/handler/health/health.go b/handler/health/health.go index 4399cf3..84467ff 100644 --- a/handler/health/health.go +++ b/handler/health/health.go @@ -1,10 +1,10 @@ -package health // import "go.unistack.org/micro-server-http/v3/handler/health" +package health // import "go.unistack.org/micro-server-http/v4/handler/health" import ( "context" - codecpb "go.unistack.org/micro-proto/v3/codec" - "go.unistack.org/micro/v3/errors" + codecpb "go.unistack.org/micro-proto/v4/codec" + "go.unistack.org/micro/v4/errors" ) var _ HealthServiceServer = &Handler{} diff --git a/handler/health/health.proto b/handler/health/health.proto index 1795501..7986943 100644 --- a/handler/health/health.proto +++ b/handler/health/health.proto @@ -1,7 +1,7 @@ syntax = "proto3"; -package micro.server.http.v3.handler.health; -option go_package = "go.unistack.org/micro-server-http/v3/handler/health;health"; +package micro.server.http.v4.handler.health; +option go_package = "go.unistack.org/micro-server-http/v4/handler/health;health"; import "api/annotations.proto"; import "openapiv3/annotations.proto"; diff --git a/handler/health/health_micro.pb.go b/handler/health/health_micro.pb.go index 3e6f6a0..767aa3a 100644 --- a/handler/health/health_micro.pb.go +++ b/handler/health/health_micro.pb.go @@ -1,22 +1,22 @@ // Code generated by protoc-gen-go-micro. DO NOT EDIT. // versions: -// - protoc-gen-go-micro v3.10.2 -// - protoc v3.21.12 +// - protoc-gen-go-micro v4.10.2 +// - protoc v4.21.12 // source: health.proto package health import ( context "context" - codec "go.unistack.org/micro-proto/v3/codec" - v3 "go.unistack.org/micro-server-http/v3" + codec "go.unistack.org/micro-proto/v4/codec" + v4 "go.unistack.org/micro-server-http/v4" ) var ( HealthServiceName = "HealthService" ) var ( - HealthServiceServerEndpoints = []v3.EndpointMetadata{ + HealthServiceServerEndpoints = []v4.EndpointMetadata{ { Name: "HealthService.Live", Path: "/live", diff --git a/handler/health/health_micro_http.pb.go b/handler/health/health_micro_http.pb.go index 0e3c6e7..b8c2362 100644 --- a/handler/health/health_micro_http.pb.go +++ b/handler/health/health_micro_http.pb.go @@ -1,14 +1,14 @@ // Code generated by protoc-gen-go-micro. DO NOT EDIT. -// protoc-gen-go-micro version: v3.10.2 +// protoc-gen-go-micro version: v4.10.2 // source: health.proto package health import ( context "context" - codec "go.unistack.org/micro-proto/v3/codec" - v3 "go.unistack.org/micro-server-http/v3" - server "go.unistack.org/micro/v3/server" + codec "go.unistack.org/micro-proto/v4/codec" + v4 "go.unistack.org/micro-server-http/v4" + server "go.unistack.org/micro/v4/server" ) type healthServiceServer struct { @@ -38,6 +38,6 @@ func RegisterHealthServiceServer(s server.Server, sh HealthServiceServer, opts . } h := &healthServiceServer{sh} var nopts []server.HandlerOption - nopts = append(nopts, v3.HandlerEndpoints(HealthServiceServerEndpoints)) + nopts = append(nopts, v4.HandlerEndpoints(HealthServiceServerEndpoints)) return s.Handle(s.NewHandler(&HealthService{h}, append(nopts, opts...)...)) } diff --git a/handler/meter/generate.go b/handler/meter/generate.go index 1605764..0342602 100644 --- a/handler/meter/generate.go +++ b/handler/meter/generate.go @@ -1,8 +1,8 @@ package meter -//go:generate sh -c "protoc -I./ -I$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v3) --go-micro_out='components=micro|http|server',standalone=false,debug=true,paths=source_relative:./ meter.proto" +//go:generate sh -c "protoc -I./ -I$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v4) --go-micro_out='components=micro|http|server',standalone=false,debug=true,paths=source_relative:./ meter.proto" import ( // import required packages - _ "go.unistack.org/micro-proto/v3/openapiv3" + _ "go.unistack.org/micro-proto/v4/openapiv3" ) diff --git a/handler/meter/meter.go b/handler/meter/meter.go index f92830e..68ea5ba 100644 --- a/handler/meter/meter.go +++ b/handler/meter/meter.go @@ -1,12 +1,12 @@ -package meter // import "go.unistack.org/micro-server-http/v3/handler/meter" +package meter // import "go.unistack.org/micro-server-http/v4/handler/meter" import ( "bytes" "context" - codecpb "go.unistack.org/micro-proto/v3/codec" - "go.unistack.org/micro/v3/errors" - "go.unistack.org/micro/v3/meter" + codecpb "go.unistack.org/micro-proto/v4/codec" + "go.unistack.org/micro/v4/errors" + "go.unistack.org/micro/v4/meter" ) // guard to fail early diff --git a/handler/meter/meter.proto b/handler/meter/meter.proto index 7fc653e..ddf23a0 100644 --- a/handler/meter/meter.proto +++ b/handler/meter/meter.proto @@ -1,7 +1,7 @@ syntax = "proto3"; -package micro.server.http.v3.handler.meter; -option go_package = "go.unistack.org/micro-server-http/v3/handler/meter;meter"; +package micro.server.http.v4.handler.meter; +option go_package = "go.unistack.org/micro-server-http/v4/handler/meter;meter"; import "api/annotations.proto"; import "openapiv3/annotations.proto"; diff --git a/handler/meter/meter_micro.pb.go b/handler/meter/meter_micro.pb.go index d9ba8aa..b426725 100644 --- a/handler/meter/meter_micro.pb.go +++ b/handler/meter/meter_micro.pb.go @@ -1,22 +1,22 @@ // Code generated by protoc-gen-go-micro. DO NOT EDIT. // versions: -// - protoc-gen-go-micro v3.10.2 -// - protoc v3.21.12 +// - protoc-gen-go-micro v4.10.2 +// - protoc v4.21.12 // source: meter.proto package meter import ( context "context" - codec "go.unistack.org/micro-proto/v3/codec" - v3 "go.unistack.org/micro-server-http/v3" + codec "go.unistack.org/micro-proto/v4/codec" + v4 "go.unistack.org/micro-server-http/v4" ) var ( MeterServiceName = "MeterService" ) var ( - MeterServiceServerEndpoints = []v3.EndpointMetadata{ + MeterServiceServerEndpoints = []v4.EndpointMetadata{ { Name: "MeterService.Metrics", Path: "/metrics", diff --git a/handler/meter/meter_micro_http.pb.go b/handler/meter/meter_micro_http.pb.go index e79500a..75c2b2a 100644 --- a/handler/meter/meter_micro_http.pb.go +++ b/handler/meter/meter_micro_http.pb.go @@ -1,14 +1,14 @@ // Code generated by protoc-gen-go-micro. DO NOT EDIT. -// protoc-gen-go-micro version: v3.10.2 +// protoc-gen-go-micro version: v4.10.2 // source: meter.proto package meter import ( context "context" - codec "go.unistack.org/micro-proto/v3/codec" - v3 "go.unistack.org/micro-server-http/v3" - server "go.unistack.org/micro/v3/server" + codec "go.unistack.org/micro-proto/v4/codec" + v4 "go.unistack.org/micro-server-http/v4" + server "go.unistack.org/micro/v4/server" ) type meterServiceServer struct { @@ -28,6 +28,6 @@ func RegisterMeterServiceServer(s server.Server, sh MeterServiceServer, opts ... } h := &meterServiceServer{sh} var nopts []server.HandlerOption - nopts = append(nopts, v3.HandlerEndpoints(MeterServiceServerEndpoints)) + nopts = append(nopts, v4.HandlerEndpoints(MeterServiceServerEndpoints)) return s.Handle(s.NewHandler(&MeterService{h}, append(nopts, opts...)...)) } diff --git a/http.go b/http.go index d23d01d..f447a0f 100644 --- a/http.go +++ b/http.go @@ -1,5 +1,5 @@ // Package http implements a go-micro.Server -package http // import "go.unistack.org/micro-server-http/v3" +package http // import "go.unistack.org/micro-server-http/v4" import ( "context" @@ -14,12 +14,12 @@ import ( "sync" "time" - "go.unistack.org/micro/v3/broker" - "go.unistack.org/micro/v3/codec" - "go.unistack.org/micro/v3/logger" - "go.unistack.org/micro/v3/register" - "go.unistack.org/micro/v3/server" - rhttp "go.unistack.org/micro/v3/util/http" + "go.unistack.org/micro/v4/broker" + "go.unistack.org/micro/v4/codec" + "go.unistack.org/micro/v4/logger" + "go.unistack.org/micro/v4/register" + "go.unistack.org/micro/v4/server" + rhttp "go.unistack.org/micro/v4/util/http" "golang.org/x/net/netutil" ) diff --git a/message.go b/message.go index 2146e5c..40e14de 100644 --- a/message.go +++ b/message.go @@ -1,8 +1,8 @@ package http import ( - "go.unistack.org/micro/v3/codec" - "go.unistack.org/micro/v3/metadata" + "go.unistack.org/micro/v4/codec" + "go.unistack.org/micro/v4/metadata" ) type httpMessage struct { diff --git a/options.go b/options.go index 3825d11..3e6fde1 100644 --- a/options.go +++ b/options.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - "go.unistack.org/micro/v3/server" + "go.unistack.org/micro/v4/server" ) // SetError pass error to caller diff --git a/request.go b/request.go index 092f33e..16ac60b 100644 --- a/request.go +++ b/request.go @@ -3,9 +3,9 @@ package http import ( "io" - "go.unistack.org/micro/v3/codec" - "go.unistack.org/micro/v3/metadata" - "go.unistack.org/micro/v3/server" + "go.unistack.org/micro/v4/codec" + "go.unistack.org/micro/v4/metadata" + "go.unistack.org/micro/v4/server" ) var ( diff --git a/server.go b/server.go index 7508467..8ea0da0 100644 --- a/server.go +++ b/server.go @@ -7,7 +7,7 @@ import ( "unicode" "unicode/utf8" - "go.unistack.org/micro/v3/server" + "go.unistack.org/micro/v4/server" ) type methodType struct { diff --git a/subscriber.go b/subscriber.go index 974ec06..9889c9d 100644 --- a/subscriber.go +++ b/subscriber.go @@ -7,11 +7,11 @@ import ( "reflect" "strings" - "go.unistack.org/micro/v3/broker" - "go.unistack.org/micro/v3/codec" - "go.unistack.org/micro/v3/metadata" - "go.unistack.org/micro/v3/register" - "go.unistack.org/micro/v3/server" + "go.unistack.org/micro/v4/broker" + "go.unistack.org/micro/v4/codec" + "go.unistack.org/micro/v4/metadata" + "go.unistack.org/micro/v4/register" + "go.unistack.org/micro/v4/server" ) var typeOfError = reflect.TypeOf((*error)(nil)).Elem() diff --git a/util.go b/util.go index 99576d3..83cc8fa 100644 --- a/util.go +++ b/util.go @@ -5,8 +5,8 @@ import ( "net/http" "strings" - "go.unistack.org/micro/v3/metadata" - rutil "go.unistack.org/micro/v3/util/reflect" + "go.unistack.org/micro/v4/metadata" + rutil "go.unistack.org/micro/v4/util/reflect" ) func FillRequest(ctx context.Context, req interface{}, opts ...FillRequestOption) error { diff --git a/util_test.go b/util_test.go index 76c7cd3..515f734 100644 --- a/util_test.go +++ b/util_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "go.unistack.org/micro/v3/metadata" + "go.unistack.org/micro/v4/metadata" ) func TestFillrequest(t *testing.T) { -- 2.45.2