From c638fce31c16a389c6be2ab3eb3a0cd8e067fbc7 Mon Sep 17 00:00:00 2001 From: Kevin Wan Date: Sat, 6 Aug 2022 16:32:12 +0800 Subject: [PATCH] chore: renaming configs (#2234) --- gateway/config.go | 9 +++++---- gateway/server.go | 2 +- go.sum | 3 --- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/gateway/config.go b/gateway/config.go index 92ac63d0..9dc56870 100644 --- a/gateway/config.go +++ b/gateway/config.go @@ -29,11 +29,12 @@ type ( Upstream struct { // Grpc is the target of the upstream. Grpc zrpc.RpcClientConf - // ProtoSets is the file list of proto set, like [hello.pb] - // if your proto file import another proto file, you need to write multi-file slice, like [hello.pb, common.pb] + // ProtoSets is the file list of proto set, like [hello.pb]. + // if your proto file import another proto file, you need to write multi-file slice, + // like [hello.pb, common.pb]. ProtoSets []string `json:",optional"` - // Mapping is the mapping between gateway routes and Upstream rpc methods. + // Mappings is the mapping between gateway routes and Upstream rpc methods. // Keep it blank if annotations are added in rpc methods. - Mapping []RouteMapping `json:",optional"` + Mappings []RouteMapping `json:",optional"` } ) diff --git a/gateway/server.go b/gateway/server.go index da155862..add1bbac 100644 --- a/gateway/server.go +++ b/gateway/server.go @@ -93,7 +93,7 @@ func (s *Server) build() error { for _, m := range methods { methodSet[m.RpcPath] = struct{}{} } - for _, m := range up.Mapping { + for _, m := range up.Mappings { if _, ok := methodSet[m.RpcPath]; !ok { cancel(fmt.Errorf("rpc method %s not found", m.RpcPath)) return diff --git a/go.sum b/go.sum index 56cd44b5..2d77bc51 100644 --- a/go.sum +++ b/go.sum @@ -474,18 +474,15 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= -go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= go.opentelemetry.io/otel/exporters/jaeger v1.9.0 h1:gAEgEVGDWwFjcis9jJTOJqZNxDzoZfR12WNIxr7g9Ww= go.opentelemetry.io/otel/exporters/jaeger v1.9.0/go.mod h1:hquezOLVAybNW6vanIxkdLXTXvzlj2Vn3wevSP15RYs= go.opentelemetry.io/otel/exporters/zipkin v1.9.0 h1:06b/nt6xao6th00aue9WU3ZDTTe+InaMXA/vym6pLuA= go.opentelemetry.io/otel/exporters/zipkin v1.9.0/go.mod h1:HyIvYIu37wV4Wx5azd7e05x9k/dOz9KB4x0plw2QNvs= -go.opentelemetry.io/otel/sdk v1.8.0/go.mod h1:uPSfc+yfDH2StDM/Rm35WE8gXSNdvCg023J6HeGNO0c= go.opentelemetry.io/otel/sdk v1.9.0 h1:LNXp1vrr83fNXTHgU8eO89mhzxb/bbWAsHG6fNf3qWo= go.opentelemetry.io/otel/sdk v1.9.0/go.mod h1:AEZc8nt5bd2F7BC24J5R0mrjYnpEgYHyTcM/vrSple4= go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= -go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4= go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47pQYc= go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=