diff --git a/generator/template.go b/generator/template.go index 6c8070e..0d0bf73 100644 --- a/generator/template.go +++ b/generator/template.go @@ -468,15 +468,24 @@ func renderURL(r *registry.Registry) func(method data.Method) string { fieldNameFn := fieldName(r) return func(method data.Method) string { methodURL := method.URL - reg := regexp.MustCompile("{([^}]+)}") + // capture fields like {abc} or {abc=def/ghi/*}. Discard the pattern after the equal sign. + reg := regexp.MustCompile("{([^=}]+)=?([^}]+)?}") matches := reg.FindAllStringSubmatch(methodURL, -1) fieldsInPath := make([]string, 0, len(matches)) if len(matches) > 0 { log.Debugf("url matches %v", matches) for _, m := range matches { expToReplace := m[0] - fieldName := fieldNameFn(m[1]) - part := fmt.Sprintf(`${req["%s"]}`, fieldName) + // convert foo_bar.baz_qux to fieldName `fooBar.bazQux`, part `${req["fooBar"]["bazQux"]}` + subFields := strings.Split(m[1], ".") + var subFieldNames, partNames []string + for _, subField := range subFields { + subFieldName := fieldNameFn(subField) + subFieldNames = append(subFieldNames, subFieldName) + partNames = append(partNames, fmt.Sprintf(`["%s"]`, subFieldName)) + } + fieldName := strings.Join(subFieldNames, ".") + part := fmt.Sprintf(`${req%s}`, strings.Join(partNames, "")) methodURL = strings.ReplaceAll(methodURL, expToReplace, part) fieldsInPath = append(fieldsInPath, fmt.Sprintf(`"%s"`, fieldName)) } diff --git a/integration_tests/integration_test.ts b/integration_tests/integration_test.ts index d598032..4f595f9 100644 --- a/integration_tests/integration_test.ts +++ b/integration_tests/integration_test.ts @@ -87,4 +87,19 @@ describe("test grpc-gateway-ts communication", () => { const result = await CounterService.HTTPGetWithZeroValueURLSearchParams({ a: "A", b: "", [getFieldName('zero_value_msg')]: { c: 1, d: [1, 0, 2], e: false } }, { pathPrefix: "http://localhost:8081" }) expect(result).to.deep.equal({ a: "A", b: "hello", [getFieldName('zero_value_msg')]: { c: 2, d: [2, 1, 3], e: true } }) }) + + it('http get request with path segments', async () => { + const result = await CounterService.HTTPGetWithPathSegments({ a: "segmented/foo" }, { pathPrefix: "http://localhost:8081" }) + expect(result.a).to.equal("segmented/foo/hello") + }) + + it('http post with field paths', async () => { + const result = await CounterService.HTTPPostWithFieldPath({ y: { x: 5, [getFieldName("nested_value")]: "foo" } }, { pathPrefix: "http://localhost:8081" }) + expect(result).to.deep.equal({ xout: 5, yout: "hello/foo" }) + }) + + it('http post with field paths and path segments', async () => { + const result = await CounterService.HTTPPostWithFieldPathAndSegments({ y: { x: 10, [getFieldName("nested_value")]: "segmented/foo" } }, { pathPrefix: "http://localhost:8081" }) + expect(result).to.deep.equal({ xout: 10, yout: "hello/segmented/foo" }) + }) }) diff --git a/integration_tests/msg.pb.go b/integration_tests/msg.pb.go index 8f14316..d2a2dbd 100644 --- a/integration_tests/msg.pb.go +++ b/integration_tests/msg.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 -// protoc v3.15.8 +// protoc-gen-go v1.27.1 +// protoc v3.19.4 // source: msg.proto package main import ( - proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -21,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type ExternalMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/integration_tests/scripts/gen-server-proto.sh b/integration_tests/scripts/gen-server-proto.sh index 3d52023..1471b1e 100755 --- a/integration_tests/scripts/gen-server-proto.sh +++ b/integration_tests/scripts/gen-server-proto.sh @@ -1,14 +1,15 @@ #!/bin/bash # remove binaries to ensure that binaries present in tools.go are installed -rm -f $GOBIN/protoc-gen-go $GOBIN/protoc-gen-grpc-gateway $GOBIN/protoc-gen-swagger +rm -f $GOBIN/protoc-gen-go $GOBIN/protoc-gen-go-grpc $GOBIN/protoc-gen-grpc-gateway $GOBIN/protoc-gen-swagger go install \ - github.com/golang/protobuf/protoc-gen-go \ + google.golang.org/protobuf/cmd/protoc-gen-go \ + google.golang.org/grpc/cmd/protoc-gen-go-grpc \ github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \ github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger -protoc -I . -I ../.. --go_out ./ --go_opt plugins=grpc --go_opt paths=source_relative \ +protoc -I . -I ../.. --go_out ./ --go-grpc_out ./ --go-grpc_opt paths=source_relative \ --grpc-gateway_out ./ --grpc-gateway_opt logtostderr=true \ --grpc-gateway_opt paths=source_relative \ --grpc-gateway_opt generate_unbound_methods=true \ diff --git a/integration_tests/service.go b/integration_tests/service.go index 2834f3f..353259f 100644 --- a/integration_tests/service.go +++ b/integration_tests/service.go @@ -107,3 +107,23 @@ func (r *RealCounterService) HTTPGetWithZeroValueURLSearchParams(ctx context.Con }, }, nil } + +func (r *RealCounterService) HTTPGetWithPathSegments(ctx context.Context, in *HTTPGetWithPathSegmentsRequest) (*HTTPGetWithPathSegmentsResponse, error) { + return &HTTPGetWithPathSegmentsResponse{ + A: in.GetA() + "/hello", + }, nil +} + +func (r *RealCounterService) HTTPPostWithFieldPath(ctx context.Context, in *HTTPPostWithFieldPathRequest) (*HTTPPostWithFieldPathResponse, error) { + return &HTTPPostWithFieldPathResponse{ + Xout: in.GetY().GetX(), + Yout: "hello/" + in.GetY().GetNestedValue(), + }, nil +} + +func (r *RealCounterService) HTTPPostWithFieldPathAndSegments(ctx context.Context, in *HTTPPostWithFieldPathRequest) (*HTTPPostWithFieldPathResponse, error) { + return &HTTPPostWithFieldPathResponse{ + Xout: in.GetY().GetX(), + Yout: "hello/" + in.GetY().GetNestedValue(), + }, nil +} diff --git a/integration_tests/service.pb.go b/integration_tests/service.pb.go index e7b2429..03c5621 100644 --- a/integration_tests/service.pb.go +++ b/integration_tests/service.pb.go @@ -1,18 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 -// protoc v3.15.8 +// protoc-gen-go v1.27.1 +// protoc v3.19.4 // source: service.proto package main import ( - context "context" - proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" @@ -27,10 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type UnaryRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1020,6 +1011,257 @@ func (x *HTTPGetWithZeroValueURLSearchParamsResponse) GetZeroValueMsg() *ZeroVal return nil } +type HTTPGetWithPathSegmentsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + A string `protobuf:"bytes,1,opt,name=a,proto3" json:"a,omitempty"` +} + +func (x *HTTPGetWithPathSegmentsRequest) Reset() { + *x = HTTPGetWithPathSegmentsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HTTPGetWithPathSegmentsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HTTPGetWithPathSegmentsRequest) ProtoMessage() {} + +func (x *HTTPGetWithPathSegmentsRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HTTPGetWithPathSegmentsRequest.ProtoReflect.Descriptor instead. +func (*HTTPGetWithPathSegmentsRequest) Descriptor() ([]byte, []int) { + return file_service_proto_rawDescGZIP(), []int{19} +} + +func (x *HTTPGetWithPathSegmentsRequest) GetA() string { + if x != nil { + return x.A + } + return "" +} + +type HTTPGetWithPathSegmentsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + A string `protobuf:"bytes,1,opt,name=a,proto3" json:"a,omitempty"` +} + +func (x *HTTPGetWithPathSegmentsResponse) Reset() { + *x = HTTPGetWithPathSegmentsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HTTPGetWithPathSegmentsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HTTPGetWithPathSegmentsResponse) ProtoMessage() {} + +func (x *HTTPGetWithPathSegmentsResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HTTPGetWithPathSegmentsResponse.ProtoReflect.Descriptor instead. +func (*HTTPGetWithPathSegmentsResponse) Descriptor() ([]byte, []int) { + return file_service_proto_rawDescGZIP(), []int{20} +} + +func (x *HTTPGetWithPathSegmentsResponse) GetA() string { + if x != nil { + return x.A + } + return "" +} + +type HTTPPostWithFieldPathRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Y *HTTPPostWithFieldPathRequest_SubMessage `protobuf:"bytes,23,opt,name=y,proto3" json:"y,omitempty"` +} + +func (x *HTTPPostWithFieldPathRequest) Reset() { + *x = HTTPPostWithFieldPathRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HTTPPostWithFieldPathRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HTTPPostWithFieldPathRequest) ProtoMessage() {} + +func (x *HTTPPostWithFieldPathRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HTTPPostWithFieldPathRequest.ProtoReflect.Descriptor instead. +func (*HTTPPostWithFieldPathRequest) Descriptor() ([]byte, []int) { + return file_service_proto_rawDescGZIP(), []int{21} +} + +func (x *HTTPPostWithFieldPathRequest) GetY() *HTTPPostWithFieldPathRequest_SubMessage { + if x != nil { + return x.Y + } + return nil +} + +type HTTPPostWithFieldPathResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Xout int32 `protobuf:"varint,11,opt,name=xout,proto3" json:"xout,omitempty"` + Yout string `protobuf:"bytes,12,opt,name=yout,proto3" json:"yout,omitempty"` +} + +func (x *HTTPPostWithFieldPathResponse) Reset() { + *x = HTTPPostWithFieldPathResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HTTPPostWithFieldPathResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HTTPPostWithFieldPathResponse) ProtoMessage() {} + +func (x *HTTPPostWithFieldPathResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HTTPPostWithFieldPathResponse.ProtoReflect.Descriptor instead. +func (*HTTPPostWithFieldPathResponse) Descriptor() ([]byte, []int) { + return file_service_proto_rawDescGZIP(), []int{22} +} + +func (x *HTTPPostWithFieldPathResponse) GetXout() int32 { + if x != nil { + return x.Xout + } + return 0 +} + +func (x *HTTPPostWithFieldPathResponse) GetYout() string { + if x != nil { + return x.Yout + } + return "" +} + +type HTTPPostWithFieldPathRequest_SubMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + X int32 `protobuf:"varint,21,opt,name=x,proto3" json:"x,omitempty"` + NestedValue string `protobuf:"bytes,22,opt,name=nested_value,json=nestedValue,proto3" json:"nested_value,omitempty"` +} + +func (x *HTTPPostWithFieldPathRequest_SubMessage) Reset() { + *x = HTTPPostWithFieldPathRequest_SubMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_service_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HTTPPostWithFieldPathRequest_SubMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HTTPPostWithFieldPathRequest_SubMessage) ProtoMessage() {} + +func (x *HTTPPostWithFieldPathRequest_SubMessage) ProtoReflect() protoreflect.Message { + mi := &file_service_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HTTPPostWithFieldPathRequest_SubMessage.ProtoReflect.Descriptor instead. +func (*HTTPPostWithFieldPathRequest_SubMessage) Descriptor() ([]byte, []int) { + return file_service_proto_rawDescGZIP(), []int{21, 0} +} + +func (x *HTTPPostWithFieldPathRequest_SubMessage) GetX() int32 { + if x != nil { + return x.X + } + return 0 +} + +func (x *HTTPPostWithFieldPathRequest_SubMessage) GetNestedValue() string { + if x != nil { + return x.NestedValue + } + return "" +} + var File_service_proto protoreflect.FileDescriptor var file_service_proto_rawDesc = []byte{ @@ -1105,75 +1347,124 @@ var file_service_proto_rawDesc = []byte{ 0x38, 0x0a, 0x0e, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x5a, 0x65, 0x72, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x73, 0x67, 0x52, 0x0c, 0x7a, 0x65, 0x72, - 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x73, 0x67, 0x32, 0xb1, 0x08, 0x0a, 0x0e, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x34, 0x0a, 0x09, - 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x2e, 0x6d, 0x61, 0x69, 0x6e, - 0x2e, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, - 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x48, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x49, - 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x16, 0x2e, 0x6d, 0x61, 0x69, 0x6e, - 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x17, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, - 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x3b, 0x0a, 0x10, - 0x46, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x73, 0x67, 0x22, 0x2e, 0x0a, 0x1e, 0x48, 0x54, 0x54, + 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x50, 0x61, 0x74, 0x68, 0x53, 0x65, 0x67, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0c, 0x0a, 0x01, 0x61, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x61, 0x22, 0x2f, 0x0a, 0x1f, 0x48, 0x54, 0x54, + 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x50, 0x61, 0x74, 0x68, 0x53, 0x65, 0x67, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0c, 0x0a, 0x01, + 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x61, 0x22, 0x9a, 0x01, 0x0a, 0x1c, 0x48, + 0x54, 0x54, 0x50, 0x50, 0x6f, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x01, 0x79, + 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, + 0x54, 0x50, 0x50, 0x6f, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, + 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x01, 0x79, 0x1a, 0x3d, 0x0a, 0x0a, 0x53, 0x75, 0x62, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x15, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x01, 0x78, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x73, 0x74, + 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x47, 0x0a, 0x1d, 0x48, 0x54, 0x54, 0x50, 0x50, + 0x6f, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x61, 0x74, 0x68, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x78, 0x6f, 0x75, 0x74, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x78, 0x6f, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x79, 0x6f, 0x75, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x79, 0x6f, 0x75, 0x74, + 0x32, 0xf1, 0x0b, 0x0a, 0x0e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x61, 0x72, - 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x45, 0x63, 0x68, - 0x6f, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x13, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x42, - 0x69, 0x6e, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x6d, - 0x61, 0x69, 0x6e, 0x2e, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x56, 0x0a, 0x07, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x12, 0x14, 0x2e, - 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x47, - 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x7b, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x6f, - 0x5f, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x7d, 0x12, 0x63, 0x0a, 0x1a, 0x48, 0x54, - 0x54, 0x50, 0x50, 0x6f, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, - 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x74, 0x68, 0x12, 0x15, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, - 0x48, 0x74, 0x74, 0x70, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x16, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, 0x6f, 0x73, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x22, - 0x09, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x2f, 0x7b, 0x61, 0x7d, 0x3a, 0x03, 0x72, 0x65, 0x71, 0x12, - 0x63, 0x0a, 0x18, 0x48, 0x54, 0x54, 0x50, 0x50, 0x6f, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x53, - 0x74, 0x61, 0x72, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x74, 0x68, 0x12, 0x15, 0x2e, 0x6d, 0x61, - 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, 0x6f, - 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x12, 0x22, 0x0d, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x2f, 0x7b, 0x61, 0x7d, 0x2f, 0x7b, 0x63, - 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x4f, 0x0a, 0x09, 0x48, 0x54, 0x54, 0x50, 0x50, 0x61, 0x74, 0x63, - 0x68, 0x12, 0x16, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, 0x61, 0x74, - 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6d, 0x61, 0x69, 0x6e, - 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x32, 0x06, 0x2f, 0x70, 0x61, 0x74, - 0x63, 0x68, 0x3a, 0x01, 0x2a, 0x12, 0x52, 0x0a, 0x0a, 0x48, 0x54, 0x54, 0x50, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x2a, 0x0b, 0x2f, 0x64, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x2f, 0x7b, 0x61, 0x7d, 0x12, 0x36, 0x0a, 0x0f, 0x45, 0x78, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x2e, 0x45, - 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, - 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x87, 0x01, 0x0a, 0x1a, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, - 0x68, 0x55, 0x52, 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x27, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x13, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x12, 0x16, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x30, 0x01, 0x12, 0x3b, 0x0a, 0x10, 0x46, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x49, 0x6e, + 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x55, + 0x6e, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6d, 0x61, + 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x37, 0x0a, 0x0a, 0x45, 0x63, 0x68, 0x6f, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x13, + 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x42, 0x69, 0x6e, 0x61, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x07, 0x48, 0x54, 0x54, + 0x50, 0x47, 0x65, 0x74, 0x12, 0x14, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, + 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6d, 0x61, 0x69, + 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x7b, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x6f, 0x5f, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, + 0x7d, 0x12, 0x63, 0x0a, 0x1a, 0x48, 0x54, 0x54, 0x50, 0x50, 0x6f, 0x73, 0x74, 0x57, 0x69, 0x74, + 0x68, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x74, 0x68, 0x12, + 0x15, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, 0x6f, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, + 0x74, 0x70, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x22, 0x09, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x2f, 0x7b, 0x61, + 0x7d, 0x3a, 0x03, 0x72, 0x65, 0x71, 0x12, 0x63, 0x0a, 0x18, 0x48, 0x54, 0x54, 0x50, 0x50, 0x6f, + 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x53, 0x74, 0x61, 0x72, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, + 0x74, 0x68, 0x12, 0x15, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, 0x6f, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6d, 0x61, 0x69, 0x6e, + 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x22, 0x0d, 0x2f, 0x70, 0x6f, 0x73, 0x74, + 0x2f, 0x7b, 0x61, 0x7d, 0x2f, 0x7b, 0x63, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x4f, 0x0a, 0x09, 0x48, + 0x54, 0x54, 0x50, 0x50, 0x61, 0x74, 0x63, 0x68, 0x12, 0x16, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, + 0x48, 0x74, 0x74, 0x70, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x17, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, 0x61, 0x74, 0x63, + 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x0b, 0x32, 0x06, 0x2f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x3a, 0x01, 0x2a, 0x12, 0x52, 0x0a, 0x0a, + 0x48, 0x54, 0x54, 0x50, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x6d, 0x61, 0x69, + 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x13, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x0d, 0x2a, 0x0b, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x2f, 0x7b, 0x61, 0x7d, + 0x12, 0x36, 0x0a, 0x0f, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x10, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x87, 0x01, 0x0a, 0x1a, 0x48, 0x54, 0x54, + 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x55, 0x52, 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, + 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x55, 0x52, 0x4c, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x28, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x55, 0x52, 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x61, 0x69, 0x6e, - 0x2e, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x55, 0x52, 0x4c, 0x53, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x7b, 0x61, 0x7d, 0x12, 0x9f, 0x01, 0x0a, 0x23, - 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x5a, 0x65, 0x72, 0x6f, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x55, 0x52, 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x30, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x47, - 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x5a, 0x65, 0x72, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x55, - 0x52, 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, 0x54, - 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x5a, 0x65, 0x72, 0x6f, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x55, 0x52, 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, - 0x12, 0x0b, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x42, 0x09, 0x5a, - 0x07, 0x2e, 0x2f, 0x3b, 0x6d, 0x61, 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x7b, + 0x61, 0x7d, 0x12, 0x9f, 0x01, 0x0a, 0x23, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, + 0x74, 0x68, 0x5a, 0x65, 0x72, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x55, 0x52, 0x4c, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x30, 0x2e, 0x6d, 0x61, 0x69, + 0x6e, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x5a, 0x65, 0x72, + 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x55, 0x52, 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6d, + 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x5a, + 0x65, 0x72, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x55, 0x52, 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x2f, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x12, 0x8b, 0x01, 0x0a, 0x17, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, + 0x57, 0x69, 0x74, 0x68, 0x50, 0x61, 0x74, 0x68, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x12, 0x24, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, + 0x69, 0x74, 0x68, 0x50, 0x61, 0x74, 0x68, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, + 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x50, 0x61, 0x74, 0x68, 0x53, 0x65, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x67, 0x65, 0x74, 0x73, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x2f, 0x7b, 0x61, 0x3d, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x2f, + 0x2a, 0x7d, 0x12, 0x87, 0x01, 0x0a, 0x15, 0x48, 0x54, 0x54, 0x50, 0x50, 0x6f, 0x73, 0x74, 0x57, + 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x61, 0x74, 0x68, 0x12, 0x22, 0x2e, 0x6d, + 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x50, 0x6f, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x23, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x50, 0x6f, 0x73, 0x74, + 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x22, 0x1a, 0x2f, + 0x70, 0x6f, 0x73, 0x74, 0x70, 0x61, 0x74, 0x68, 0x2f, 0x7b, 0x79, 0x2e, 0x6e, 0x65, 0x73, 0x74, + 0x65, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x7d, 0x3a, 0x01, 0x79, 0x12, 0xa5, 0x01, 0x0a, + 0x20, 0x48, 0x54, 0x54, 0x50, 0x50, 0x6f, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x50, 0x61, 0x74, 0x68, 0x41, 0x6e, 0x64, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x12, 0x22, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x50, 0x6f, 0x73, + 0x74, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, 0x54, + 0x50, 0x50, 0x6f, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x61, + 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x32, 0x22, 0x2d, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x70, 0x61, 0x74, 0x68, 0x73, 0x65, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b, 0x79, 0x2e, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x2f, 0x2a, + 0x7d, 0x3a, 0x01, 0x79, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x2f, 0x3b, 0x6d, 0x61, 0x69, 0x6e, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1188,7 +1479,7 @@ func file_service_proto_rawDescGZIP() []byte { return file_service_proto_rawDescData } -var file_service_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_service_proto_msgTypes = make([]protoimpl.MessageInfo, 24) var file_service_proto_goTypes = []interface{}{ (*UnaryRequest)(nil), // 0: main.UnaryRequest (*UnaryResponse)(nil), // 1: main.UnaryResponse @@ -1209,46 +1500,58 @@ var file_service_proto_goTypes = []interface{}{ (*ZeroValueMsg)(nil), // 16: main.ZeroValueMsg (*HTTPGetWithZeroValueURLSearchParamsRequest)(nil), // 17: main.HTTPGetWithZeroValueURLSearchParamsRequest (*HTTPGetWithZeroValueURLSearchParamsResponse)(nil), // 18: main.HTTPGetWithZeroValueURLSearchParamsResponse - (*ExternalMessage)(nil), // 19: ExternalMessage - (*ExternalRequest)(nil), // 20: ExternalRequest - (*emptypb.Empty)(nil), // 21: google.protobuf.Empty - (*ExternalResponse)(nil), // 22: ExternalResponse + (*HTTPGetWithPathSegmentsRequest)(nil), // 19: main.HTTPGetWithPathSegmentsRequest + (*HTTPGetWithPathSegmentsResponse)(nil), // 20: main.HTTPGetWithPathSegmentsResponse + (*HTTPPostWithFieldPathRequest)(nil), // 21: main.HTTPPostWithFieldPathRequest + (*HTTPPostWithFieldPathResponse)(nil), // 22: main.HTTPPostWithFieldPathResponse + (*HTTPPostWithFieldPathRequest_SubMessage)(nil), // 23: main.HTTPPostWithFieldPathRequest.SubMessage + (*ExternalMessage)(nil), // 24: ExternalMessage + (*ExternalRequest)(nil), // 25: ExternalRequest + (*emptypb.Empty)(nil), // 26: google.protobuf.Empty + (*ExternalResponse)(nil), // 27: ExternalResponse } var file_service_proto_depIdxs = []int32{ 9, // 0: main.HttpPostRequest.req:type_name -> main.PostRequest 9, // 1: main.HTTPGetWithURLSearchParamsRequest.post_req:type_name -> main.PostRequest - 19, // 2: main.HTTPGetWithURLSearchParamsRequest.ext_msg:type_name -> ExternalMessage + 24, // 2: main.HTTPGetWithURLSearchParamsRequest.ext_msg:type_name -> ExternalMessage 16, // 3: main.HTTPGetWithZeroValueURLSearchParamsRequest.zero_value_msg:type_name -> main.ZeroValueMsg 16, // 4: main.HTTPGetWithZeroValueURLSearchParamsResponse.zero_value_msg:type_name -> main.ZeroValueMsg - 0, // 5: main.CounterService.Increment:input_type -> main.UnaryRequest - 4, // 6: main.CounterService.StreamingIncrements:input_type -> main.StreamingRequest - 0, // 7: main.CounterService.FailingIncrement:input_type -> main.UnaryRequest - 2, // 8: main.CounterService.EchoBinary:input_type -> main.BinaryRequest - 6, // 9: main.CounterService.HTTPGet:input_type -> main.HttpGetRequest - 8, // 10: main.CounterService.HTTPPostWithNestedBodyPath:input_type -> main.HttpPostRequest - 8, // 11: main.CounterService.HTTPPostWithStarBodyPath:input_type -> main.HttpPostRequest - 11, // 12: main.CounterService.HTTPPatch:input_type -> main.HttpPatchRequest - 13, // 13: main.CounterService.HTTPDelete:input_type -> main.HttpDeleteRequest - 20, // 14: main.CounterService.ExternalMessage:input_type -> ExternalRequest - 14, // 15: main.CounterService.HTTPGetWithURLSearchParams:input_type -> main.HTTPGetWithURLSearchParamsRequest - 17, // 16: main.CounterService.HTTPGetWithZeroValueURLSearchParams:input_type -> main.HTTPGetWithZeroValueURLSearchParamsRequest - 1, // 17: main.CounterService.Increment:output_type -> main.UnaryResponse - 5, // 18: main.CounterService.StreamingIncrements:output_type -> main.StreamingResponse - 1, // 19: main.CounterService.FailingIncrement:output_type -> main.UnaryResponse - 3, // 20: main.CounterService.EchoBinary:output_type -> main.BinaryResponse - 7, // 21: main.CounterService.HTTPGet:output_type -> main.HttpGetResponse - 10, // 22: main.CounterService.HTTPPostWithNestedBodyPath:output_type -> main.HttpPostResponse - 10, // 23: main.CounterService.HTTPPostWithStarBodyPath:output_type -> main.HttpPostResponse - 12, // 24: main.CounterService.HTTPPatch:output_type -> main.HttpPatchResponse - 21, // 25: main.CounterService.HTTPDelete:output_type -> google.protobuf.Empty - 22, // 26: main.CounterService.ExternalMessage:output_type -> ExternalResponse - 15, // 27: main.CounterService.HTTPGetWithURLSearchParams:output_type -> main.HTTPGetWithURLSearchParamsResponse - 18, // 28: main.CounterService.HTTPGetWithZeroValueURLSearchParams:output_type -> main.HTTPGetWithZeroValueURLSearchParamsResponse - 17, // [17:29] is the sub-list for method output_type - 5, // [5:17] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 23, // 5: main.HTTPPostWithFieldPathRequest.y:type_name -> main.HTTPPostWithFieldPathRequest.SubMessage + 0, // 6: main.CounterService.Increment:input_type -> main.UnaryRequest + 4, // 7: main.CounterService.StreamingIncrements:input_type -> main.StreamingRequest + 0, // 8: main.CounterService.FailingIncrement:input_type -> main.UnaryRequest + 2, // 9: main.CounterService.EchoBinary:input_type -> main.BinaryRequest + 6, // 10: main.CounterService.HTTPGet:input_type -> main.HttpGetRequest + 8, // 11: main.CounterService.HTTPPostWithNestedBodyPath:input_type -> main.HttpPostRequest + 8, // 12: main.CounterService.HTTPPostWithStarBodyPath:input_type -> main.HttpPostRequest + 11, // 13: main.CounterService.HTTPPatch:input_type -> main.HttpPatchRequest + 13, // 14: main.CounterService.HTTPDelete:input_type -> main.HttpDeleteRequest + 25, // 15: main.CounterService.ExternalMessage:input_type -> ExternalRequest + 14, // 16: main.CounterService.HTTPGetWithURLSearchParams:input_type -> main.HTTPGetWithURLSearchParamsRequest + 17, // 17: main.CounterService.HTTPGetWithZeroValueURLSearchParams:input_type -> main.HTTPGetWithZeroValueURLSearchParamsRequest + 19, // 18: main.CounterService.HTTPGetWithPathSegments:input_type -> main.HTTPGetWithPathSegmentsRequest + 21, // 19: main.CounterService.HTTPPostWithFieldPath:input_type -> main.HTTPPostWithFieldPathRequest + 21, // 20: main.CounterService.HTTPPostWithFieldPathAndSegments:input_type -> main.HTTPPostWithFieldPathRequest + 1, // 21: main.CounterService.Increment:output_type -> main.UnaryResponse + 5, // 22: main.CounterService.StreamingIncrements:output_type -> main.StreamingResponse + 1, // 23: main.CounterService.FailingIncrement:output_type -> main.UnaryResponse + 3, // 24: main.CounterService.EchoBinary:output_type -> main.BinaryResponse + 7, // 25: main.CounterService.HTTPGet:output_type -> main.HttpGetResponse + 10, // 26: main.CounterService.HTTPPostWithNestedBodyPath:output_type -> main.HttpPostResponse + 10, // 27: main.CounterService.HTTPPostWithStarBodyPath:output_type -> main.HttpPostResponse + 12, // 28: main.CounterService.HTTPPatch:output_type -> main.HttpPatchResponse + 26, // 29: main.CounterService.HTTPDelete:output_type -> google.protobuf.Empty + 27, // 30: main.CounterService.ExternalMessage:output_type -> ExternalResponse + 15, // 31: main.CounterService.HTTPGetWithURLSearchParams:output_type -> main.HTTPGetWithURLSearchParamsResponse + 18, // 32: main.CounterService.HTTPGetWithZeroValueURLSearchParams:output_type -> main.HTTPGetWithZeroValueURLSearchParamsResponse + 20, // 33: main.CounterService.HTTPGetWithPathSegments:output_type -> main.HTTPGetWithPathSegmentsResponse + 22, // 34: main.CounterService.HTTPPostWithFieldPath:output_type -> main.HTTPPostWithFieldPathResponse + 22, // 35: main.CounterService.HTTPPostWithFieldPathAndSegments:output_type -> main.HTTPPostWithFieldPathResponse + 21, // [21:36] is the sub-list for method output_type + 6, // [6:21] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_service_proto_init() } @@ -1486,6 +1789,66 @@ func file_service_proto_init() { return nil } } + file_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HTTPGetWithPathSegmentsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HTTPGetWithPathSegmentsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HTTPPostWithFieldPathRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HTTPPostWithFieldPathResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HTTPPostWithFieldPathRequest_SubMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1493,7 +1856,7 @@ func file_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_proto_rawDesc, NumEnums: 0, - NumMessages: 19, + NumMessages: 24, NumExtensions: 0, NumServices: 1, }, @@ -1506,507 +1869,3 @@ func file_service_proto_init() { file_service_proto_goTypes = nil file_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// CounterServiceClient is the client API for CounterService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type CounterServiceClient interface { - Increment(ctx context.Context, in *UnaryRequest, opts ...grpc.CallOption) (*UnaryResponse, error) - StreamingIncrements(ctx context.Context, in *StreamingRequest, opts ...grpc.CallOption) (CounterService_StreamingIncrementsClient, error) - FailingIncrement(ctx context.Context, in *UnaryRequest, opts ...grpc.CallOption) (*UnaryResponse, error) - EchoBinary(ctx context.Context, in *BinaryRequest, opts ...grpc.CallOption) (*BinaryResponse, error) - HTTPGet(ctx context.Context, in *HttpGetRequest, opts ...grpc.CallOption) (*HttpGetResponse, error) - HTTPPostWithNestedBodyPath(ctx context.Context, in *HttpPostRequest, opts ...grpc.CallOption) (*HttpPostResponse, error) - HTTPPostWithStarBodyPath(ctx context.Context, in *HttpPostRequest, opts ...grpc.CallOption) (*HttpPostResponse, error) - HTTPPatch(ctx context.Context, in *HttpPatchRequest, opts ...grpc.CallOption) (*HttpPatchResponse, error) - HTTPDelete(ctx context.Context, in *HttpDeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - ExternalMessage(ctx context.Context, in *ExternalRequest, opts ...grpc.CallOption) (*ExternalResponse, error) - HTTPGetWithURLSearchParams(ctx context.Context, in *HTTPGetWithURLSearchParamsRequest, opts ...grpc.CallOption) (*HTTPGetWithURLSearchParamsResponse, error) - HTTPGetWithZeroValueURLSearchParams(ctx context.Context, in *HTTPGetWithZeroValueURLSearchParamsRequest, opts ...grpc.CallOption) (*HTTPGetWithZeroValueURLSearchParamsResponse, error) -} - -type counterServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewCounterServiceClient(cc grpc.ClientConnInterface) CounterServiceClient { - return &counterServiceClient{cc} -} - -func (c *counterServiceClient) Increment(ctx context.Context, in *UnaryRequest, opts ...grpc.CallOption) (*UnaryResponse, error) { - out := new(UnaryResponse) - err := c.cc.Invoke(ctx, "/main.CounterService/Increment", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *counterServiceClient) StreamingIncrements(ctx context.Context, in *StreamingRequest, opts ...grpc.CallOption) (CounterService_StreamingIncrementsClient, error) { - stream, err := c.cc.NewStream(ctx, &_CounterService_serviceDesc.Streams[0], "/main.CounterService/StreamingIncrements", opts...) - if err != nil { - return nil, err - } - x := &counterServiceStreamingIncrementsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type CounterService_StreamingIncrementsClient interface { - Recv() (*StreamingResponse, error) - grpc.ClientStream -} - -type counterServiceStreamingIncrementsClient struct { - grpc.ClientStream -} - -func (x *counterServiceStreamingIncrementsClient) Recv() (*StreamingResponse, error) { - m := new(StreamingResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *counterServiceClient) FailingIncrement(ctx context.Context, in *UnaryRequest, opts ...grpc.CallOption) (*UnaryResponse, error) { - out := new(UnaryResponse) - err := c.cc.Invoke(ctx, "/main.CounterService/FailingIncrement", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *counterServiceClient) EchoBinary(ctx context.Context, in *BinaryRequest, opts ...grpc.CallOption) (*BinaryResponse, error) { - out := new(BinaryResponse) - err := c.cc.Invoke(ctx, "/main.CounterService/EchoBinary", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *counterServiceClient) HTTPGet(ctx context.Context, in *HttpGetRequest, opts ...grpc.CallOption) (*HttpGetResponse, error) { - out := new(HttpGetResponse) - err := c.cc.Invoke(ctx, "/main.CounterService/HTTPGet", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *counterServiceClient) HTTPPostWithNestedBodyPath(ctx context.Context, in *HttpPostRequest, opts ...grpc.CallOption) (*HttpPostResponse, error) { - out := new(HttpPostResponse) - err := c.cc.Invoke(ctx, "/main.CounterService/HTTPPostWithNestedBodyPath", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *counterServiceClient) HTTPPostWithStarBodyPath(ctx context.Context, in *HttpPostRequest, opts ...grpc.CallOption) (*HttpPostResponse, error) { - out := new(HttpPostResponse) - err := c.cc.Invoke(ctx, "/main.CounterService/HTTPPostWithStarBodyPath", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *counterServiceClient) HTTPPatch(ctx context.Context, in *HttpPatchRequest, opts ...grpc.CallOption) (*HttpPatchResponse, error) { - out := new(HttpPatchResponse) - err := c.cc.Invoke(ctx, "/main.CounterService/HTTPPatch", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *counterServiceClient) HTTPDelete(ctx context.Context, in *HttpDeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/main.CounterService/HTTPDelete", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *counterServiceClient) ExternalMessage(ctx context.Context, in *ExternalRequest, opts ...grpc.CallOption) (*ExternalResponse, error) { - out := new(ExternalResponse) - err := c.cc.Invoke(ctx, "/main.CounterService/ExternalMessage", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *counterServiceClient) HTTPGetWithURLSearchParams(ctx context.Context, in *HTTPGetWithURLSearchParamsRequest, opts ...grpc.CallOption) (*HTTPGetWithURLSearchParamsResponse, error) { - out := new(HTTPGetWithURLSearchParamsResponse) - err := c.cc.Invoke(ctx, "/main.CounterService/HTTPGetWithURLSearchParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *counterServiceClient) HTTPGetWithZeroValueURLSearchParams(ctx context.Context, in *HTTPGetWithZeroValueURLSearchParamsRequest, opts ...grpc.CallOption) (*HTTPGetWithZeroValueURLSearchParamsResponse, error) { - out := new(HTTPGetWithZeroValueURLSearchParamsResponse) - err := c.cc.Invoke(ctx, "/main.CounterService/HTTPGetWithZeroValueURLSearchParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// CounterServiceServer is the server API for CounterService service. -type CounterServiceServer interface { - Increment(context.Context, *UnaryRequest) (*UnaryResponse, error) - StreamingIncrements(*StreamingRequest, CounterService_StreamingIncrementsServer) error - FailingIncrement(context.Context, *UnaryRequest) (*UnaryResponse, error) - EchoBinary(context.Context, *BinaryRequest) (*BinaryResponse, error) - HTTPGet(context.Context, *HttpGetRequest) (*HttpGetResponse, error) - HTTPPostWithNestedBodyPath(context.Context, *HttpPostRequest) (*HttpPostResponse, error) - HTTPPostWithStarBodyPath(context.Context, *HttpPostRequest) (*HttpPostResponse, error) - HTTPPatch(context.Context, *HttpPatchRequest) (*HttpPatchResponse, error) - HTTPDelete(context.Context, *HttpDeleteRequest) (*emptypb.Empty, error) - ExternalMessage(context.Context, *ExternalRequest) (*ExternalResponse, error) - HTTPGetWithURLSearchParams(context.Context, *HTTPGetWithURLSearchParamsRequest) (*HTTPGetWithURLSearchParamsResponse, error) - HTTPGetWithZeroValueURLSearchParams(context.Context, *HTTPGetWithZeroValueURLSearchParamsRequest) (*HTTPGetWithZeroValueURLSearchParamsResponse, error) -} - -// UnimplementedCounterServiceServer can be embedded to have forward compatible implementations. -type UnimplementedCounterServiceServer struct { -} - -func (*UnimplementedCounterServiceServer) Increment(context.Context, *UnaryRequest) (*UnaryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Increment not implemented") -} -func (*UnimplementedCounterServiceServer) StreamingIncrements(*StreamingRequest, CounterService_StreamingIncrementsServer) error { - return status.Errorf(codes.Unimplemented, "method StreamingIncrements not implemented") -} -func (*UnimplementedCounterServiceServer) FailingIncrement(context.Context, *UnaryRequest) (*UnaryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FailingIncrement not implemented") -} -func (*UnimplementedCounterServiceServer) EchoBinary(context.Context, *BinaryRequest) (*BinaryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method EchoBinary not implemented") -} -func (*UnimplementedCounterServiceServer) HTTPGet(context.Context, *HttpGetRequest) (*HttpGetResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method HTTPGet not implemented") -} -func (*UnimplementedCounterServiceServer) HTTPPostWithNestedBodyPath(context.Context, *HttpPostRequest) (*HttpPostResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method HTTPPostWithNestedBodyPath not implemented") -} -func (*UnimplementedCounterServiceServer) HTTPPostWithStarBodyPath(context.Context, *HttpPostRequest) (*HttpPostResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method HTTPPostWithStarBodyPath not implemented") -} -func (*UnimplementedCounterServiceServer) HTTPPatch(context.Context, *HttpPatchRequest) (*HttpPatchResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method HTTPPatch not implemented") -} -func (*UnimplementedCounterServiceServer) HTTPDelete(context.Context, *HttpDeleteRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method HTTPDelete not implemented") -} -func (*UnimplementedCounterServiceServer) ExternalMessage(context.Context, *ExternalRequest) (*ExternalResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExternalMessage not implemented") -} -func (*UnimplementedCounterServiceServer) HTTPGetWithURLSearchParams(context.Context, *HTTPGetWithURLSearchParamsRequest) (*HTTPGetWithURLSearchParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method HTTPGetWithURLSearchParams not implemented") -} -func (*UnimplementedCounterServiceServer) HTTPGetWithZeroValueURLSearchParams(context.Context, *HTTPGetWithZeroValueURLSearchParamsRequest) (*HTTPGetWithZeroValueURLSearchParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method HTTPGetWithZeroValueURLSearchParams not implemented") -} - -func RegisterCounterServiceServer(s *grpc.Server, srv CounterServiceServer) { - s.RegisterService(&_CounterService_serviceDesc, srv) -} - -func _CounterService_Increment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UnaryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CounterServiceServer).Increment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/main.CounterService/Increment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CounterServiceServer).Increment(ctx, req.(*UnaryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CounterService_StreamingIncrements_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(StreamingRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(CounterServiceServer).StreamingIncrements(m, &counterServiceStreamingIncrementsServer{stream}) -} - -type CounterService_StreamingIncrementsServer interface { - Send(*StreamingResponse) error - grpc.ServerStream -} - -type counterServiceStreamingIncrementsServer struct { - grpc.ServerStream -} - -func (x *counterServiceStreamingIncrementsServer) Send(m *StreamingResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _CounterService_FailingIncrement_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UnaryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CounterServiceServer).FailingIncrement(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/main.CounterService/FailingIncrement", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CounterServiceServer).FailingIncrement(ctx, req.(*UnaryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CounterService_EchoBinary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BinaryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CounterServiceServer).EchoBinary(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/main.CounterService/EchoBinary", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CounterServiceServer).EchoBinary(ctx, req.(*BinaryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CounterService_HTTPGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HttpGetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CounterServiceServer).HTTPGet(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/main.CounterService/HTTPGet", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CounterServiceServer).HTTPGet(ctx, req.(*HttpGetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CounterService_HTTPPostWithNestedBodyPath_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HttpPostRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CounterServiceServer).HTTPPostWithNestedBodyPath(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/main.CounterService/HTTPPostWithNestedBodyPath", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CounterServiceServer).HTTPPostWithNestedBodyPath(ctx, req.(*HttpPostRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CounterService_HTTPPostWithStarBodyPath_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HttpPostRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CounterServiceServer).HTTPPostWithStarBodyPath(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/main.CounterService/HTTPPostWithStarBodyPath", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CounterServiceServer).HTTPPostWithStarBodyPath(ctx, req.(*HttpPostRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CounterService_HTTPPatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HttpPatchRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CounterServiceServer).HTTPPatch(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/main.CounterService/HTTPPatch", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CounterServiceServer).HTTPPatch(ctx, req.(*HttpPatchRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CounterService_HTTPDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HttpDeleteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CounterServiceServer).HTTPDelete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/main.CounterService/HTTPDelete", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CounterServiceServer).HTTPDelete(ctx, req.(*HttpDeleteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CounterService_ExternalMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ExternalRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CounterServiceServer).ExternalMessage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/main.CounterService/ExternalMessage", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CounterServiceServer).ExternalMessage(ctx, req.(*ExternalRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CounterService_HTTPGetWithURLSearchParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HTTPGetWithURLSearchParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CounterServiceServer).HTTPGetWithURLSearchParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/main.CounterService/HTTPGetWithURLSearchParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CounterServiceServer).HTTPGetWithURLSearchParams(ctx, req.(*HTTPGetWithURLSearchParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CounterService_HTTPGetWithZeroValueURLSearchParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HTTPGetWithZeroValueURLSearchParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CounterServiceServer).HTTPGetWithZeroValueURLSearchParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/main.CounterService/HTTPGetWithZeroValueURLSearchParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CounterServiceServer).HTTPGetWithZeroValueURLSearchParams(ctx, req.(*HTTPGetWithZeroValueURLSearchParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _CounterService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "main.CounterService", - HandlerType: (*CounterServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Increment", - Handler: _CounterService_Increment_Handler, - }, - { - MethodName: "FailingIncrement", - Handler: _CounterService_FailingIncrement_Handler, - }, - { - MethodName: "EchoBinary", - Handler: _CounterService_EchoBinary_Handler, - }, - { - MethodName: "HTTPGet", - Handler: _CounterService_HTTPGet_Handler, - }, - { - MethodName: "HTTPPostWithNestedBodyPath", - Handler: _CounterService_HTTPPostWithNestedBodyPath_Handler, - }, - { - MethodName: "HTTPPostWithStarBodyPath", - Handler: _CounterService_HTTPPostWithStarBodyPath_Handler, - }, - { - MethodName: "HTTPPatch", - Handler: _CounterService_HTTPPatch_Handler, - }, - { - MethodName: "HTTPDelete", - Handler: _CounterService_HTTPDelete_Handler, - }, - { - MethodName: "ExternalMessage", - Handler: _CounterService_ExternalMessage_Handler, - }, - { - MethodName: "HTTPGetWithURLSearchParams", - Handler: _CounterService_HTTPGetWithURLSearchParams_Handler, - }, - { - MethodName: "HTTPGetWithZeroValueURLSearchParams", - Handler: _CounterService_HTTPGetWithZeroValueURLSearchParams_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamingIncrements", - Handler: _CounterService_StreamingIncrements_Handler, - ServerStreams: true, - }, - }, - Metadata: "service.proto", -} diff --git a/integration_tests/service.pb.gw.go b/integration_tests/service.pb.gw.go index c2d98d9..632e04a 100644 --- a/integration_tests/service.pb.gw.go +++ b/integration_tests/service.pb.gw.go @@ -624,6 +624,200 @@ func local_request_CounterService_HTTPGetWithZeroValueURLSearchParams_0(ctx cont } +func request_CounterService_HTTPGetWithPathSegments_0(ctx context.Context, marshaler runtime.Marshaler, client CounterServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq HTTPGetWithPathSegmentsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["a"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "a") + } + + protoReq.A, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "a", err) + } + + msg, err := client.HTTPGetWithPathSegments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CounterService_HTTPGetWithPathSegments_0(ctx context.Context, marshaler runtime.Marshaler, server CounterServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq HTTPGetWithPathSegmentsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["a"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "a") + } + + protoReq.A, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "a", err) + } + + msg, err := server.HTTPGetWithPathSegments(ctx, &protoReq) + return msg, metadata, err + +} + +func request_CounterService_HTTPPostWithFieldPath_0(ctx context.Context, marshaler runtime.Marshaler, client CounterServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq HTTPPostWithFieldPathRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Y); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["y.nested_value"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "y.nested_value") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "y.nested_value", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "y.nested_value", err) + } + + msg, err := client.HTTPPostWithFieldPath(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CounterService_HTTPPostWithFieldPath_0(ctx context.Context, marshaler runtime.Marshaler, server CounterServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq HTTPPostWithFieldPathRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Y); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["y.nested_value"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "y.nested_value") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "y.nested_value", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "y.nested_value", err) + } + + msg, err := server.HTTPPostWithFieldPath(ctx, &protoReq) + return msg, metadata, err + +} + +func request_CounterService_HTTPPostWithFieldPathAndSegments_0(ctx context.Context, marshaler runtime.Marshaler, client CounterServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq HTTPPostWithFieldPathRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Y); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["y.nested_value"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "y.nested_value") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "y.nested_value", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "y.nested_value", err) + } + + msg, err := client.HTTPPostWithFieldPathAndSegments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CounterService_HTTPPostWithFieldPathAndSegments_0(ctx context.Context, marshaler runtime.Marshaler, server CounterServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq HTTPPostWithFieldPathRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Y); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["y.nested_value"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "y.nested_value") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "y.nested_value", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "y.nested_value", err) + } + + msg, err := server.HTTPPostWithFieldPathAndSegments(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterCounterServiceHandlerServer registers the http handlers for service CounterService to "mux". // UnaryRPC :call CounterServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -890,6 +1084,75 @@ func RegisterCounterServiceHandlerServer(ctx context.Context, mux *runtime.Serve }) + mux.Handle("GET", pattern_CounterService_HTTPGetWithPathSegments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CounterService_HTTPGetWithPathSegments_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CounterService_HTTPGetWithPathSegments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_CounterService_HTTPPostWithFieldPath_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CounterService_HTTPPostWithFieldPath_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CounterService_HTTPPostWithFieldPath_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_CounterService_HTTPPostWithFieldPathAndSegments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CounterService_HTTPPostWithFieldPathAndSegments_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CounterService_HTTPPostWithFieldPathAndSegments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1171,6 +1434,66 @@ func RegisterCounterServiceHandlerClient(ctx context.Context, mux *runtime.Serve }) + mux.Handle("GET", pattern_CounterService_HTTPGetWithPathSegments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CounterService_HTTPGetWithPathSegments_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CounterService_HTTPGetWithPathSegments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_CounterService_HTTPPostWithFieldPath_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CounterService_HTTPPostWithFieldPath_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CounterService_HTTPPostWithFieldPath_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_CounterService_HTTPPostWithFieldPathAndSegments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CounterService_HTTPPostWithFieldPathAndSegments_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CounterService_HTTPPostWithFieldPathAndSegments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1198,6 +1521,12 @@ var ( pattern_CounterService_HTTPGetWithURLSearchParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"api", "query", "a"}, "", runtime.AssumeColonVerbOpt(true))) pattern_CounterService_HTTPGetWithZeroValueURLSearchParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"path", "query"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_CounterService_HTTPGetWithPathSegments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"getsegment", "segmented", "a"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_CounterService_HTTPPostWithFieldPath_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"postpath", "y.nested_value"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_CounterService_HTTPPostWithFieldPathAndSegments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"postpathsegment", "segmented", "y.nested_value"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -1224,4 +1553,10 @@ var ( forward_CounterService_HTTPGetWithURLSearchParams_0 = runtime.ForwardResponseMessage forward_CounterService_HTTPGetWithZeroValueURLSearchParams_0 = runtime.ForwardResponseMessage + + forward_CounterService_HTTPGetWithPathSegments_0 = runtime.ForwardResponseMessage + + forward_CounterService_HTTPPostWithFieldPath_0 = runtime.ForwardResponseMessage + + forward_CounterService_HTTPPostWithFieldPathAndSegments_0 = runtime.ForwardResponseMessage ) diff --git a/integration_tests/service.proto b/integration_tests/service.proto index 1ade546..e1b6431 100644 --- a/integration_tests/service.proto +++ b/integration_tests/service.proto @@ -94,6 +94,27 @@ message HTTPGetWithZeroValueURLSearchParamsResponse { ZeroValueMsg zero_value_msg = 3; } +message HTTPGetWithPathSegmentsRequest { + string a = 1; +} + +message HTTPGetWithPathSegmentsResponse { + string a = 1; +} + +message HTTPPostWithFieldPathRequest { + message SubMessage { + int32 x = 21; + string nested_value = 22; + } + SubMessage y = 23; +} + +message HTTPPostWithFieldPathResponse { + int32 xout = 11; + string yout = 12; +} + service CounterService { rpc Increment(UnaryRequest) returns (UnaryResponse); rpc StreamingIncrements(StreamingRequest) returns (stream StreamingResponse); @@ -138,5 +159,22 @@ service CounterService { get: "/path/query" }; } + rpc HTTPGetWithPathSegments(HTTPGetWithPathSegmentsRequest) returns (HTTPGetWithPathSegmentsResponse) { + option (google.api.http) = { + get: "/getsegment/{a=segmented/*}" + }; + } + rpc HTTPPostWithFieldPath(HTTPPostWithFieldPathRequest) returns (HTTPPostWithFieldPathResponse) { + option (google.api.http) = { + post: "/postpath/{y.nested_value}" + body: "y" + }; + } + rpc HTTPPostWithFieldPathAndSegments(HTTPPostWithFieldPathRequest) returns (HTTPPostWithFieldPathResponse) { + option (google.api.http) = { + post: "/postpathsegment/{y.nested_value=segmented/*}" + body: "y" + }; + } } diff --git a/integration_tests/service_grpc.pb.go b/integration_tests/service_grpc.pb.go new file mode 100644 index 0000000..c4f253d --- /dev/null +++ b/integration_tests/service_grpc.pb.go @@ -0,0 +1,634 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package main + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// CounterServiceClient is the client API for CounterService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type CounterServiceClient interface { + Increment(ctx context.Context, in *UnaryRequest, opts ...grpc.CallOption) (*UnaryResponse, error) + StreamingIncrements(ctx context.Context, in *StreamingRequest, opts ...grpc.CallOption) (CounterService_StreamingIncrementsClient, error) + FailingIncrement(ctx context.Context, in *UnaryRequest, opts ...grpc.CallOption) (*UnaryResponse, error) + EchoBinary(ctx context.Context, in *BinaryRequest, opts ...grpc.CallOption) (*BinaryResponse, error) + HTTPGet(ctx context.Context, in *HttpGetRequest, opts ...grpc.CallOption) (*HttpGetResponse, error) + HTTPPostWithNestedBodyPath(ctx context.Context, in *HttpPostRequest, opts ...grpc.CallOption) (*HttpPostResponse, error) + HTTPPostWithStarBodyPath(ctx context.Context, in *HttpPostRequest, opts ...grpc.CallOption) (*HttpPostResponse, error) + HTTPPatch(ctx context.Context, in *HttpPatchRequest, opts ...grpc.CallOption) (*HttpPatchResponse, error) + HTTPDelete(ctx context.Context, in *HttpDeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + ExternalMessage(ctx context.Context, in *ExternalRequest, opts ...grpc.CallOption) (*ExternalResponse, error) + HTTPGetWithURLSearchParams(ctx context.Context, in *HTTPGetWithURLSearchParamsRequest, opts ...grpc.CallOption) (*HTTPGetWithURLSearchParamsResponse, error) + HTTPGetWithZeroValueURLSearchParams(ctx context.Context, in *HTTPGetWithZeroValueURLSearchParamsRequest, opts ...grpc.CallOption) (*HTTPGetWithZeroValueURLSearchParamsResponse, error) + HTTPGetWithPathSegments(ctx context.Context, in *HTTPGetWithPathSegmentsRequest, opts ...grpc.CallOption) (*HTTPGetWithPathSegmentsResponse, error) + HTTPPostWithFieldPath(ctx context.Context, in *HTTPPostWithFieldPathRequest, opts ...grpc.CallOption) (*HTTPPostWithFieldPathResponse, error) + HTTPPostWithFieldPathAndSegments(ctx context.Context, in *HTTPPostWithFieldPathRequest, opts ...grpc.CallOption) (*HTTPPostWithFieldPathResponse, error) +} + +type counterServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewCounterServiceClient(cc grpc.ClientConnInterface) CounterServiceClient { + return &counterServiceClient{cc} +} + +func (c *counterServiceClient) Increment(ctx context.Context, in *UnaryRequest, opts ...grpc.CallOption) (*UnaryResponse, error) { + out := new(UnaryResponse) + err := c.cc.Invoke(ctx, "/main.CounterService/Increment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *counterServiceClient) StreamingIncrements(ctx context.Context, in *StreamingRequest, opts ...grpc.CallOption) (CounterService_StreamingIncrementsClient, error) { + stream, err := c.cc.NewStream(ctx, &CounterService_ServiceDesc.Streams[0], "/main.CounterService/StreamingIncrements", opts...) + if err != nil { + return nil, err + } + x := &counterServiceStreamingIncrementsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type CounterService_StreamingIncrementsClient interface { + Recv() (*StreamingResponse, error) + grpc.ClientStream +} + +type counterServiceStreamingIncrementsClient struct { + grpc.ClientStream +} + +func (x *counterServiceStreamingIncrementsClient) Recv() (*StreamingResponse, error) { + m := new(StreamingResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *counterServiceClient) FailingIncrement(ctx context.Context, in *UnaryRequest, opts ...grpc.CallOption) (*UnaryResponse, error) { + out := new(UnaryResponse) + err := c.cc.Invoke(ctx, "/main.CounterService/FailingIncrement", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *counterServiceClient) EchoBinary(ctx context.Context, in *BinaryRequest, opts ...grpc.CallOption) (*BinaryResponse, error) { + out := new(BinaryResponse) + err := c.cc.Invoke(ctx, "/main.CounterService/EchoBinary", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *counterServiceClient) HTTPGet(ctx context.Context, in *HttpGetRequest, opts ...grpc.CallOption) (*HttpGetResponse, error) { + out := new(HttpGetResponse) + err := c.cc.Invoke(ctx, "/main.CounterService/HTTPGet", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *counterServiceClient) HTTPPostWithNestedBodyPath(ctx context.Context, in *HttpPostRequest, opts ...grpc.CallOption) (*HttpPostResponse, error) { + out := new(HttpPostResponse) + err := c.cc.Invoke(ctx, "/main.CounterService/HTTPPostWithNestedBodyPath", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *counterServiceClient) HTTPPostWithStarBodyPath(ctx context.Context, in *HttpPostRequest, opts ...grpc.CallOption) (*HttpPostResponse, error) { + out := new(HttpPostResponse) + err := c.cc.Invoke(ctx, "/main.CounterService/HTTPPostWithStarBodyPath", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *counterServiceClient) HTTPPatch(ctx context.Context, in *HttpPatchRequest, opts ...grpc.CallOption) (*HttpPatchResponse, error) { + out := new(HttpPatchResponse) + err := c.cc.Invoke(ctx, "/main.CounterService/HTTPPatch", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *counterServiceClient) HTTPDelete(ctx context.Context, in *HttpDeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/main.CounterService/HTTPDelete", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *counterServiceClient) ExternalMessage(ctx context.Context, in *ExternalRequest, opts ...grpc.CallOption) (*ExternalResponse, error) { + out := new(ExternalResponse) + err := c.cc.Invoke(ctx, "/main.CounterService/ExternalMessage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *counterServiceClient) HTTPGetWithURLSearchParams(ctx context.Context, in *HTTPGetWithURLSearchParamsRequest, opts ...grpc.CallOption) (*HTTPGetWithURLSearchParamsResponse, error) { + out := new(HTTPGetWithURLSearchParamsResponse) + err := c.cc.Invoke(ctx, "/main.CounterService/HTTPGetWithURLSearchParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *counterServiceClient) HTTPGetWithZeroValueURLSearchParams(ctx context.Context, in *HTTPGetWithZeroValueURLSearchParamsRequest, opts ...grpc.CallOption) (*HTTPGetWithZeroValueURLSearchParamsResponse, error) { + out := new(HTTPGetWithZeroValueURLSearchParamsResponse) + err := c.cc.Invoke(ctx, "/main.CounterService/HTTPGetWithZeroValueURLSearchParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *counterServiceClient) HTTPGetWithPathSegments(ctx context.Context, in *HTTPGetWithPathSegmentsRequest, opts ...grpc.CallOption) (*HTTPGetWithPathSegmentsResponse, error) { + out := new(HTTPGetWithPathSegmentsResponse) + err := c.cc.Invoke(ctx, "/main.CounterService/HTTPGetWithPathSegments", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *counterServiceClient) HTTPPostWithFieldPath(ctx context.Context, in *HTTPPostWithFieldPathRequest, opts ...grpc.CallOption) (*HTTPPostWithFieldPathResponse, error) { + out := new(HTTPPostWithFieldPathResponse) + err := c.cc.Invoke(ctx, "/main.CounterService/HTTPPostWithFieldPath", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *counterServiceClient) HTTPPostWithFieldPathAndSegments(ctx context.Context, in *HTTPPostWithFieldPathRequest, opts ...grpc.CallOption) (*HTTPPostWithFieldPathResponse, error) { + out := new(HTTPPostWithFieldPathResponse) + err := c.cc.Invoke(ctx, "/main.CounterService/HTTPPostWithFieldPathAndSegments", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// CounterServiceServer is the server API for CounterService service. +// All implementations must embed UnimplementedCounterServiceServer +// for forward compatibility +type CounterServiceServer interface { + Increment(context.Context, *UnaryRequest) (*UnaryResponse, error) + StreamingIncrements(*StreamingRequest, CounterService_StreamingIncrementsServer) error + FailingIncrement(context.Context, *UnaryRequest) (*UnaryResponse, error) + EchoBinary(context.Context, *BinaryRequest) (*BinaryResponse, error) + HTTPGet(context.Context, *HttpGetRequest) (*HttpGetResponse, error) + HTTPPostWithNestedBodyPath(context.Context, *HttpPostRequest) (*HttpPostResponse, error) + HTTPPostWithStarBodyPath(context.Context, *HttpPostRequest) (*HttpPostResponse, error) + HTTPPatch(context.Context, *HttpPatchRequest) (*HttpPatchResponse, error) + HTTPDelete(context.Context, *HttpDeleteRequest) (*emptypb.Empty, error) + ExternalMessage(context.Context, *ExternalRequest) (*ExternalResponse, error) + HTTPGetWithURLSearchParams(context.Context, *HTTPGetWithURLSearchParamsRequest) (*HTTPGetWithURLSearchParamsResponse, error) + HTTPGetWithZeroValueURLSearchParams(context.Context, *HTTPGetWithZeroValueURLSearchParamsRequest) (*HTTPGetWithZeroValueURLSearchParamsResponse, error) + HTTPGetWithPathSegments(context.Context, *HTTPGetWithPathSegmentsRequest) (*HTTPGetWithPathSegmentsResponse, error) + HTTPPostWithFieldPath(context.Context, *HTTPPostWithFieldPathRequest) (*HTTPPostWithFieldPathResponse, error) + HTTPPostWithFieldPathAndSegments(context.Context, *HTTPPostWithFieldPathRequest) (*HTTPPostWithFieldPathResponse, error) + mustEmbedUnimplementedCounterServiceServer() +} + +// UnimplementedCounterServiceServer must be embedded to have forward compatible implementations. +type UnimplementedCounterServiceServer struct { +} + +func (UnimplementedCounterServiceServer) Increment(context.Context, *UnaryRequest) (*UnaryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Increment not implemented") +} +func (UnimplementedCounterServiceServer) StreamingIncrements(*StreamingRequest, CounterService_StreamingIncrementsServer) error { + return status.Errorf(codes.Unimplemented, "method StreamingIncrements not implemented") +} +func (UnimplementedCounterServiceServer) FailingIncrement(context.Context, *UnaryRequest) (*UnaryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FailingIncrement not implemented") +} +func (UnimplementedCounterServiceServer) EchoBinary(context.Context, *BinaryRequest) (*BinaryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EchoBinary not implemented") +} +func (UnimplementedCounterServiceServer) HTTPGet(context.Context, *HttpGetRequest) (*HttpGetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HTTPGet not implemented") +} +func (UnimplementedCounterServiceServer) HTTPPostWithNestedBodyPath(context.Context, *HttpPostRequest) (*HttpPostResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HTTPPostWithNestedBodyPath not implemented") +} +func (UnimplementedCounterServiceServer) HTTPPostWithStarBodyPath(context.Context, *HttpPostRequest) (*HttpPostResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HTTPPostWithStarBodyPath not implemented") +} +func (UnimplementedCounterServiceServer) HTTPPatch(context.Context, *HttpPatchRequest) (*HttpPatchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HTTPPatch not implemented") +} +func (UnimplementedCounterServiceServer) HTTPDelete(context.Context, *HttpDeleteRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method HTTPDelete not implemented") +} +func (UnimplementedCounterServiceServer) ExternalMessage(context.Context, *ExternalRequest) (*ExternalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExternalMessage not implemented") +} +func (UnimplementedCounterServiceServer) HTTPGetWithURLSearchParams(context.Context, *HTTPGetWithURLSearchParamsRequest) (*HTTPGetWithURLSearchParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HTTPGetWithURLSearchParams not implemented") +} +func (UnimplementedCounterServiceServer) HTTPGetWithZeroValueURLSearchParams(context.Context, *HTTPGetWithZeroValueURLSearchParamsRequest) (*HTTPGetWithZeroValueURLSearchParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HTTPGetWithZeroValueURLSearchParams not implemented") +} +func (UnimplementedCounterServiceServer) HTTPGetWithPathSegments(context.Context, *HTTPGetWithPathSegmentsRequest) (*HTTPGetWithPathSegmentsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HTTPGetWithPathSegments not implemented") +} +func (UnimplementedCounterServiceServer) HTTPPostWithFieldPath(context.Context, *HTTPPostWithFieldPathRequest) (*HTTPPostWithFieldPathResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HTTPPostWithFieldPath not implemented") +} +func (UnimplementedCounterServiceServer) HTTPPostWithFieldPathAndSegments(context.Context, *HTTPPostWithFieldPathRequest) (*HTTPPostWithFieldPathResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HTTPPostWithFieldPathAndSegments not implemented") +} +func (UnimplementedCounterServiceServer) mustEmbedUnimplementedCounterServiceServer() {} + +// UnsafeCounterServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to CounterServiceServer will +// result in compilation errors. +type UnsafeCounterServiceServer interface { + mustEmbedUnimplementedCounterServiceServer() +} + +func RegisterCounterServiceServer(s grpc.ServiceRegistrar, srv CounterServiceServer) { + s.RegisterService(&CounterService_ServiceDesc, srv) +} + +func _CounterService_Increment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnaryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CounterServiceServer).Increment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/main.CounterService/Increment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CounterServiceServer).Increment(ctx, req.(*UnaryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CounterService_StreamingIncrements_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(StreamingRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(CounterServiceServer).StreamingIncrements(m, &counterServiceStreamingIncrementsServer{stream}) +} + +type CounterService_StreamingIncrementsServer interface { + Send(*StreamingResponse) error + grpc.ServerStream +} + +type counterServiceStreamingIncrementsServer struct { + grpc.ServerStream +} + +func (x *counterServiceStreamingIncrementsServer) Send(m *StreamingResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _CounterService_FailingIncrement_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnaryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CounterServiceServer).FailingIncrement(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/main.CounterService/FailingIncrement", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CounterServiceServer).FailingIncrement(ctx, req.(*UnaryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CounterService_EchoBinary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BinaryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CounterServiceServer).EchoBinary(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/main.CounterService/EchoBinary", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CounterServiceServer).EchoBinary(ctx, req.(*BinaryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CounterService_HTTPGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HttpGetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CounterServiceServer).HTTPGet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/main.CounterService/HTTPGet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CounterServiceServer).HTTPGet(ctx, req.(*HttpGetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CounterService_HTTPPostWithNestedBodyPath_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HttpPostRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CounterServiceServer).HTTPPostWithNestedBodyPath(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/main.CounterService/HTTPPostWithNestedBodyPath", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CounterServiceServer).HTTPPostWithNestedBodyPath(ctx, req.(*HttpPostRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CounterService_HTTPPostWithStarBodyPath_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HttpPostRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CounterServiceServer).HTTPPostWithStarBodyPath(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/main.CounterService/HTTPPostWithStarBodyPath", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CounterServiceServer).HTTPPostWithStarBodyPath(ctx, req.(*HttpPostRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CounterService_HTTPPatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HttpPatchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CounterServiceServer).HTTPPatch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/main.CounterService/HTTPPatch", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CounterServiceServer).HTTPPatch(ctx, req.(*HttpPatchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CounterService_HTTPDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HttpDeleteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CounterServiceServer).HTTPDelete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/main.CounterService/HTTPDelete", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CounterServiceServer).HTTPDelete(ctx, req.(*HttpDeleteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CounterService_ExternalMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExternalRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CounterServiceServer).ExternalMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/main.CounterService/ExternalMessage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CounterServiceServer).ExternalMessage(ctx, req.(*ExternalRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CounterService_HTTPGetWithURLSearchParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HTTPGetWithURLSearchParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CounterServiceServer).HTTPGetWithURLSearchParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/main.CounterService/HTTPGetWithURLSearchParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CounterServiceServer).HTTPGetWithURLSearchParams(ctx, req.(*HTTPGetWithURLSearchParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CounterService_HTTPGetWithZeroValueURLSearchParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HTTPGetWithZeroValueURLSearchParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CounterServiceServer).HTTPGetWithZeroValueURLSearchParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/main.CounterService/HTTPGetWithZeroValueURLSearchParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CounterServiceServer).HTTPGetWithZeroValueURLSearchParams(ctx, req.(*HTTPGetWithZeroValueURLSearchParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CounterService_HTTPGetWithPathSegments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HTTPGetWithPathSegmentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CounterServiceServer).HTTPGetWithPathSegments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/main.CounterService/HTTPGetWithPathSegments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CounterServiceServer).HTTPGetWithPathSegments(ctx, req.(*HTTPGetWithPathSegmentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CounterService_HTTPPostWithFieldPath_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HTTPPostWithFieldPathRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CounterServiceServer).HTTPPostWithFieldPath(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/main.CounterService/HTTPPostWithFieldPath", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CounterServiceServer).HTTPPostWithFieldPath(ctx, req.(*HTTPPostWithFieldPathRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CounterService_HTTPPostWithFieldPathAndSegments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HTTPPostWithFieldPathRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CounterServiceServer).HTTPPostWithFieldPathAndSegments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/main.CounterService/HTTPPostWithFieldPathAndSegments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CounterServiceServer).HTTPPostWithFieldPathAndSegments(ctx, req.(*HTTPPostWithFieldPathRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// CounterService_ServiceDesc is the grpc.ServiceDesc for CounterService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var CounterService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "main.CounterService", + HandlerType: (*CounterServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Increment", + Handler: _CounterService_Increment_Handler, + }, + { + MethodName: "FailingIncrement", + Handler: _CounterService_FailingIncrement_Handler, + }, + { + MethodName: "EchoBinary", + Handler: _CounterService_EchoBinary_Handler, + }, + { + MethodName: "HTTPGet", + Handler: _CounterService_HTTPGet_Handler, + }, + { + MethodName: "HTTPPostWithNestedBodyPath", + Handler: _CounterService_HTTPPostWithNestedBodyPath_Handler, + }, + { + MethodName: "HTTPPostWithStarBodyPath", + Handler: _CounterService_HTTPPostWithStarBodyPath_Handler, + }, + { + MethodName: "HTTPPatch", + Handler: _CounterService_HTTPPatch_Handler, + }, + { + MethodName: "HTTPDelete", + Handler: _CounterService_HTTPDelete_Handler, + }, + { + MethodName: "ExternalMessage", + Handler: _CounterService_ExternalMessage_Handler, + }, + { + MethodName: "HTTPGetWithURLSearchParams", + Handler: _CounterService_HTTPGetWithURLSearchParams_Handler, + }, + { + MethodName: "HTTPGetWithZeroValueURLSearchParams", + Handler: _CounterService_HTTPGetWithZeroValueURLSearchParams_Handler, + }, + { + MethodName: "HTTPGetWithPathSegments", + Handler: _CounterService_HTTPGetWithPathSegments_Handler, + }, + { + MethodName: "HTTPPostWithFieldPath", + Handler: _CounterService_HTTPPostWithFieldPath_Handler, + }, + { + MethodName: "HTTPPostWithFieldPathAndSegments", + Handler: _CounterService_HTTPPostWithFieldPathAndSegments_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamingIncrements", + Handler: _CounterService_StreamingIncrements_Handler, + ServerStreams: true, + }, + }, + Metadata: "service.proto", +}