Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2022-07-26 15:27:40 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-07-27 06:53:38 +0300
commitc5ca566139c5855201904f0b428ff18a732ae3fa (patch)
tree28c7f19cb940993fddfb1e87435a46c569a7958c
parent1b1bb4b66b23ce776eb70cd20428eb91b2dc4793 (diff)
proxy: Remove now-unused test service definitionspks-grpc-proxy-test-refactorings
The test service definitions used by the grpc-proxy package aren't used by anything anymore given that we have now converted all tests to instead use the `grpc_testing` test package. Remove the test definitions.
-rw-r--r--Makefile1
-rw-r--r--internal/praefect/grpc-proxy/testdata/test.pb.go306
-rw-r--r--internal/praefect/grpc-proxy/testdata/test.proto31
-rw-r--r--internal/praefect/grpc-proxy/testdata/test_grpc.pb.go309
4 files changed, 0 insertions, 647 deletions
diff --git a/Makefile b/Makefile
index 06cec69a8..42b3677d8 100644
--- a/Makefile
+++ b/Makefile
@@ -493,7 +493,6 @@ proto: ${PROTOC} ${PROTOC_GEN_GO} ${PROTOC_GEN_GO_GRPC} ${PROTOC_GEN_GITALY_PROT
${PROTOC} ${SHARED_PROTOC_OPTS} -I ${SOURCE_DIR}/proto -I ${PROTOC_INSTALL_DIR}/include --go_out=${SOURCE_DIR}/proto/go/gitalypb --gitaly-protolist_out=proto_dir=${SOURCE_DIR}/proto,gitalypb_dir=${SOURCE_DIR}/proto/go/gitalypb:${SOURCE_DIR} --go-grpc_out=${SOURCE_DIR}/proto/go/gitalypb ${SOURCE_DIR}/proto/*.proto
${SOURCE_DIR}/_support/generate-proto-ruby
@ # this part is related to the generation of sources from testing proto files
- ${PROTOC} ${SHARED_PROTOC_OPTS} -I ${SOURCE_DIR}/internal --go_out=${SOURCE_DIR}/internal --go-grpc_out=${SOURCE_DIR}/internal ${SOURCE_DIR}/internal/praefect/grpc-proxy/testdata/test.proto
${PROTOC} ${SHARED_PROTOC_OPTS} -I ${SOURCE_DIR}/proto -I ${SOURCE_DIR}/internal -I ${PROTOC_INSTALL_DIR}/include --go_out=${SOURCE_DIR}/internal --go-grpc_out=${SOURCE_DIR}/internal \
${SOURCE_DIR}/internal/praefect/mock/mock.proto \
${SOURCE_DIR}/internal/middleware/cache/testdata/stream.proto \
diff --git a/internal/praefect/grpc-proxy/testdata/test.pb.go b/internal/praefect/grpc-proxy/testdata/test.pb.go
deleted file mode 100644
index ec62c5466..000000000
--- a/internal/praefect/grpc-proxy/testdata/test.pb.go
+++ /dev/null
@@ -1,306 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// protoc-gen-go v1.28.0
-// protoc v3.21.1
-// source: praefect/grpc-proxy/testdata/test.proto
-
-package testdata
-
-import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- reflect "reflect"
- sync "sync"
-)
-
-const (
- // Verify that this generated code is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
- // Verify that runtime/protoimpl is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
-)
-
-type Empty struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-}
-
-func (x *Empty) Reset() {
- *x = Empty{}
- if protoimpl.UnsafeEnabled {
- mi := &file_praefect_grpc_proxy_testdata_test_proto_msgTypes[0]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *Empty) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Empty) ProtoMessage() {}
-
-func (x *Empty) ProtoReflect() protoreflect.Message {
- mi := &file_praefect_grpc_proxy_testdata_test_proto_msgTypes[0]
- 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 Empty.ProtoReflect.Descriptor instead.
-func (*Empty) Descriptor() ([]byte, []int) {
- return file_praefect_grpc_proxy_testdata_test_proto_rawDescGZIP(), []int{0}
-}
-
-type PingRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
-}
-
-func (x *PingRequest) Reset() {
- *x = PingRequest{}
- if protoimpl.UnsafeEnabled {
- mi := &file_praefect_grpc_proxy_testdata_test_proto_msgTypes[1]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *PingRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*PingRequest) ProtoMessage() {}
-
-func (x *PingRequest) ProtoReflect() protoreflect.Message {
- mi := &file_praefect_grpc_proxy_testdata_test_proto_msgTypes[1]
- 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 PingRequest.ProtoReflect.Descriptor instead.
-func (*PingRequest) Descriptor() ([]byte, []int) {
- return file_praefect_grpc_proxy_testdata_test_proto_rawDescGZIP(), []int{1}
-}
-
-func (x *PingRequest) GetValue() string {
- if x != nil {
- return x.Value
- }
- return ""
-}
-
-type PingResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Value string `protobuf:"bytes,1,opt,name=Value,proto3" json:"Value,omitempty"`
- Counter int32 `protobuf:"varint,2,opt,name=counter,proto3" json:"counter,omitempty"`
-}
-
-func (x *PingResponse) Reset() {
- *x = PingResponse{}
- if protoimpl.UnsafeEnabled {
- mi := &file_praefect_grpc_proxy_testdata_test_proto_msgTypes[2]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *PingResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*PingResponse) ProtoMessage() {}
-
-func (x *PingResponse) ProtoReflect() protoreflect.Message {
- mi := &file_praefect_grpc_proxy_testdata_test_proto_msgTypes[2]
- 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 PingResponse.ProtoReflect.Descriptor instead.
-func (*PingResponse) Descriptor() ([]byte, []int) {
- return file_praefect_grpc_proxy_testdata_test_proto_rawDescGZIP(), []int{2}
-}
-
-func (x *PingResponse) GetValue() string {
- if x != nil {
- return x.Value
- }
- return ""
-}
-
-func (x *PingResponse) GetCounter() int32 {
- if x != nil {
- return x.Counter
- }
- return 0
-}
-
-var File_praefect_grpc_proxy_testdata_test_proto protoreflect.FileDescriptor
-
-var file_praefect_grpc_proxy_testdata_test_proto_rawDesc = []byte{
- 0x0a, 0x27, 0x70, 0x72, 0x61, 0x65, 0x66, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d,
- 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x74,
- 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x6d, 0x77, 0x69, 0x74, 0x6b,
- 0x6f, 0x77, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x07, 0x0a, 0x05,
- 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x23, 0x0a, 0x0b, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3e, 0x0a, 0x0c, 0x50, 0x69,
- 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x56, 0x61,
- 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65,
- 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28,
- 0x05, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x32, 0x91, 0x03, 0x0a, 0x0b, 0x54,
- 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x48, 0x0a, 0x09, 0x50, 0x69,
- 0x6e, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x18, 0x2e, 0x6d, 0x77, 0x69, 0x74, 0x6b, 0x6f,
- 0x77, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74,
- 0x79, 0x1a, 0x1f, 0x2e, 0x6d, 0x77, 0x69, 0x74, 0x6b, 0x6f, 0x77, 0x2e, 0x74, 0x65, 0x73, 0x74,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
- 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x1e, 0x2e, 0x6d,
- 0x77, 0x69, 0x74, 0x6b, 0x6f, 0x77, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d,
- 0x77, 0x69, 0x74, 0x6b, 0x6f, 0x77, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
- 0x47, 0x0a, 0x09, 0x50, 0x69, 0x6e, 0x67, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1e, 0x2e, 0x6d,
- 0x77, 0x69, 0x74, 0x6b, 0x6f, 0x77, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6d,
- 0x77, 0x69, 0x74, 0x6b, 0x6f, 0x77, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x08, 0x50, 0x69, 0x6e, 0x67,
- 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x6d, 0x77, 0x69, 0x74, 0x6b, 0x6f, 0x77, 0x2e, 0x74,
- 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x77, 0x69, 0x74, 0x6b, 0x6f, 0x77, 0x2e, 0x74,
- 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73,
- 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x53, 0x0a, 0x0a, 0x50, 0x69, 0x6e,
- 0x67, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x1e, 0x2e, 0x6d, 0x77, 0x69, 0x74, 0x6b, 0x6f,
- 0x77, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x69, 0x6e, 0x67,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x77, 0x69, 0x74, 0x6b, 0x6f,
- 0x77, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x69, 0x6e, 0x67,
- 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x48,
- 0x5a, 0x46, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74,
- 0x6c, 0x61, 0x62, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2f, 0x76,
- 0x31, 0x35, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x61, 0x65,
- 0x66, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f,
- 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
-
-var (
- file_praefect_grpc_proxy_testdata_test_proto_rawDescOnce sync.Once
- file_praefect_grpc_proxy_testdata_test_proto_rawDescData = file_praefect_grpc_proxy_testdata_test_proto_rawDesc
-)
-
-func file_praefect_grpc_proxy_testdata_test_proto_rawDescGZIP() []byte {
- file_praefect_grpc_proxy_testdata_test_proto_rawDescOnce.Do(func() {
- file_praefect_grpc_proxy_testdata_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_praefect_grpc_proxy_testdata_test_proto_rawDescData)
- })
- return file_praefect_grpc_proxy_testdata_test_proto_rawDescData
-}
-
-var file_praefect_grpc_proxy_testdata_test_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
-var file_praefect_grpc_proxy_testdata_test_proto_goTypes = []interface{}{
- (*Empty)(nil), // 0: mwitkow.testproto.Empty
- (*PingRequest)(nil), // 1: mwitkow.testproto.PingRequest
- (*PingResponse)(nil), // 2: mwitkow.testproto.PingResponse
-}
-var file_praefect_grpc_proxy_testdata_test_proto_depIdxs = []int32{
- 0, // 0: mwitkow.testproto.TestService.PingEmpty:input_type -> mwitkow.testproto.Empty
- 1, // 1: mwitkow.testproto.TestService.Ping:input_type -> mwitkow.testproto.PingRequest
- 1, // 2: mwitkow.testproto.TestService.PingError:input_type -> mwitkow.testproto.PingRequest
- 1, // 3: mwitkow.testproto.TestService.PingList:input_type -> mwitkow.testproto.PingRequest
- 1, // 4: mwitkow.testproto.TestService.PingStream:input_type -> mwitkow.testproto.PingRequest
- 2, // 5: mwitkow.testproto.TestService.PingEmpty:output_type -> mwitkow.testproto.PingResponse
- 2, // 6: mwitkow.testproto.TestService.Ping:output_type -> mwitkow.testproto.PingResponse
- 0, // 7: mwitkow.testproto.TestService.PingError:output_type -> mwitkow.testproto.Empty
- 2, // 8: mwitkow.testproto.TestService.PingList:output_type -> mwitkow.testproto.PingResponse
- 2, // 9: mwitkow.testproto.TestService.PingStream:output_type -> mwitkow.testproto.PingResponse
- 5, // [5:10] is the sub-list for method output_type
- 0, // [0:5] is the sub-list for method input_type
- 0, // [0:0] is the sub-list for extension type_name
- 0, // [0:0] is the sub-list for extension extendee
- 0, // [0:0] is the sub-list for field type_name
-}
-
-func init() { file_praefect_grpc_proxy_testdata_test_proto_init() }
-func file_praefect_grpc_proxy_testdata_test_proto_init() {
- if File_praefect_grpc_proxy_testdata_test_proto != nil {
- return
- }
- if !protoimpl.UnsafeEnabled {
- file_praefect_grpc_proxy_testdata_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*Empty); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_praefect_grpc_proxy_testdata_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*PingRequest); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_praefect_grpc_proxy_testdata_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*PingResponse); 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{
- File: protoimpl.DescBuilder{
- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_praefect_grpc_proxy_testdata_test_proto_rawDesc,
- NumEnums: 0,
- NumMessages: 3,
- NumExtensions: 0,
- NumServices: 1,
- },
- GoTypes: file_praefect_grpc_proxy_testdata_test_proto_goTypes,
- DependencyIndexes: file_praefect_grpc_proxy_testdata_test_proto_depIdxs,
- MessageInfos: file_praefect_grpc_proxy_testdata_test_proto_msgTypes,
- }.Build()
- File_praefect_grpc_proxy_testdata_test_proto = out.File
- file_praefect_grpc_proxy_testdata_test_proto_rawDesc = nil
- file_praefect_grpc_proxy_testdata_test_proto_goTypes = nil
- file_praefect_grpc_proxy_testdata_test_proto_depIdxs = nil
-}
diff --git a/internal/praefect/grpc-proxy/testdata/test.proto b/internal/praefect/grpc-proxy/testdata/test.proto
deleted file mode 100644
index 227d3cbeb..000000000
--- a/internal/praefect/grpc-proxy/testdata/test.proto
+++ /dev/null
@@ -1,31 +0,0 @@
-syntax = "proto3";
-
-package mwitkow.testproto;
-
-option go_package = "gitlab.com/gitlab-org/gitaly/v15/internal/praefect/grpc-proxy/testdata";
-
-message Empty {
-}
-
-message PingRequest {
- string value = 1;
-}
-
-message PingResponse {
- string Value = 1;
- int32 counter = 2;
-}
-
-service TestService {
- rpc PingEmpty(Empty) returns (PingResponse) {}
-
- rpc Ping(PingRequest) returns (PingResponse) {}
-
- rpc PingError(PingRequest) returns (Empty) {}
-
- rpc PingList(PingRequest) returns (stream PingResponse) {}
-
- rpc PingStream(stream PingRequest) returns (stream PingResponse) {}
-
-}
-
diff --git a/internal/praefect/grpc-proxy/testdata/test_grpc.pb.go b/internal/praefect/grpc-proxy/testdata/test_grpc.pb.go
deleted file mode 100644
index d1b660df2..000000000
--- a/internal/praefect/grpc-proxy/testdata/test_grpc.pb.go
+++ /dev/null
@@ -1,309 +0,0 @@
-// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
-// versions:
-// - protoc-gen-go-grpc v1.2.0
-// - protoc v3.21.1
-// source: praefect/grpc-proxy/testdata/test.proto
-
-package testdata
-
-import (
- context "context"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
-)
-
-// 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
-
-// TestServiceClient is the client API for TestService 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 TestServiceClient interface {
- PingEmpty(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*PingResponse, error)
- Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
- PingError(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*Empty, error)
- PingList(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (TestService_PingListClient, error)
- PingStream(ctx context.Context, opts ...grpc.CallOption) (TestService_PingStreamClient, error)
-}
-
-type testServiceClient struct {
- cc grpc.ClientConnInterface
-}
-
-func NewTestServiceClient(cc grpc.ClientConnInterface) TestServiceClient {
- return &testServiceClient{cc}
-}
-
-func (c *testServiceClient) PingEmpty(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*PingResponse, error) {
- out := new(PingResponse)
- err := c.cc.Invoke(ctx, "/mwitkow.testproto.TestService/PingEmpty", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *testServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) {
- out := new(PingResponse)
- err := c.cc.Invoke(ctx, "/mwitkow.testproto.TestService/Ping", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *testServiceClient) PingError(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*Empty, error) {
- out := new(Empty)
- err := c.cc.Invoke(ctx, "/mwitkow.testproto.TestService/PingError", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *testServiceClient) PingList(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (TestService_PingListClient, error) {
- stream, err := c.cc.NewStream(ctx, &TestService_ServiceDesc.Streams[0], "/mwitkow.testproto.TestService/PingList", opts...)
- if err != nil {
- return nil, err
- }
- x := &testServicePingListClient{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 TestService_PingListClient interface {
- Recv() (*PingResponse, error)
- grpc.ClientStream
-}
-
-type testServicePingListClient struct {
- grpc.ClientStream
-}
-
-func (x *testServicePingListClient) Recv() (*PingResponse, error) {
- m := new(PingResponse)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func (c *testServiceClient) PingStream(ctx context.Context, opts ...grpc.CallOption) (TestService_PingStreamClient, error) {
- stream, err := c.cc.NewStream(ctx, &TestService_ServiceDesc.Streams[1], "/mwitkow.testproto.TestService/PingStream", opts...)
- if err != nil {
- return nil, err
- }
- x := &testServicePingStreamClient{stream}
- return x, nil
-}
-
-type TestService_PingStreamClient interface {
- Send(*PingRequest) error
- Recv() (*PingResponse, error)
- grpc.ClientStream
-}
-
-type testServicePingStreamClient struct {
- grpc.ClientStream
-}
-
-func (x *testServicePingStreamClient) Send(m *PingRequest) error {
- return x.ClientStream.SendMsg(m)
-}
-
-func (x *testServicePingStreamClient) Recv() (*PingResponse, error) {
- m := new(PingResponse)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-// TestServiceServer is the server API for TestService service.
-// All implementations must embed UnimplementedTestServiceServer
-// for forward compatibility
-type TestServiceServer interface {
- PingEmpty(context.Context, *Empty) (*PingResponse, error)
- Ping(context.Context, *PingRequest) (*PingResponse, error)
- PingError(context.Context, *PingRequest) (*Empty, error)
- PingList(*PingRequest, TestService_PingListServer) error
- PingStream(TestService_PingStreamServer) error
- mustEmbedUnimplementedTestServiceServer()
-}
-
-// UnimplementedTestServiceServer must be embedded to have forward compatible implementations.
-type UnimplementedTestServiceServer struct {
-}
-
-func (UnimplementedTestServiceServer) PingEmpty(context.Context, *Empty) (*PingResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method PingEmpty not implemented")
-}
-func (UnimplementedTestServiceServer) Ping(context.Context, *PingRequest) (*PingResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
-}
-func (UnimplementedTestServiceServer) PingError(context.Context, *PingRequest) (*Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method PingError not implemented")
-}
-func (UnimplementedTestServiceServer) PingList(*PingRequest, TestService_PingListServer) error {
- return status.Errorf(codes.Unimplemented, "method PingList not implemented")
-}
-func (UnimplementedTestServiceServer) PingStream(TestService_PingStreamServer) error {
- return status.Errorf(codes.Unimplemented, "method PingStream not implemented")
-}
-func (UnimplementedTestServiceServer) mustEmbedUnimplementedTestServiceServer() {}
-
-// UnsafeTestServiceServer may be embedded to opt out of forward compatibility for this service.
-// Use of this interface is not recommended, as added methods to TestServiceServer will
-// result in compilation errors.
-type UnsafeTestServiceServer interface {
- mustEmbedUnimplementedTestServiceServer()
-}
-
-func RegisterTestServiceServer(s grpc.ServiceRegistrar, srv TestServiceServer) {
- s.RegisterService(&TestService_ServiceDesc, srv)
-}
-
-func _TestService_PingEmpty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(Empty)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TestServiceServer).PingEmpty(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/mwitkow.testproto.TestService/PingEmpty",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TestServiceServer).PingEmpty(ctx, req.(*Empty))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _TestService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(PingRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TestServiceServer).Ping(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/mwitkow.testproto.TestService/Ping",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TestServiceServer).Ping(ctx, req.(*PingRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _TestService_PingError_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(PingRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TestServiceServer).PingError(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/mwitkow.testproto.TestService/PingError",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TestServiceServer).PingError(ctx, req.(*PingRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _TestService_PingList_Handler(srv interface{}, stream grpc.ServerStream) error {
- m := new(PingRequest)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(TestServiceServer).PingList(m, &testServicePingListServer{stream})
-}
-
-type TestService_PingListServer interface {
- Send(*PingResponse) error
- grpc.ServerStream
-}
-
-type testServicePingListServer struct {
- grpc.ServerStream
-}
-
-func (x *testServicePingListServer) Send(m *PingResponse) error {
- return x.ServerStream.SendMsg(m)
-}
-
-func _TestService_PingStream_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(TestServiceServer).PingStream(&testServicePingStreamServer{stream})
-}
-
-type TestService_PingStreamServer interface {
- Send(*PingResponse) error
- Recv() (*PingRequest, error)
- grpc.ServerStream
-}
-
-type testServicePingStreamServer struct {
- grpc.ServerStream
-}
-
-func (x *testServicePingStreamServer) Send(m *PingResponse) error {
- return x.ServerStream.SendMsg(m)
-}
-
-func (x *testServicePingStreamServer) Recv() (*PingRequest, error) {
- m := new(PingRequest)
- if err := x.ServerStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-// TestService_ServiceDesc is the grpc.ServiceDesc for TestService service.
-// It's only intended for direct use with grpc.RegisterService,
-// and not to be introspected or modified (even as a copy)
-var TestService_ServiceDesc = grpc.ServiceDesc{
- ServiceName: "mwitkow.testproto.TestService",
- HandlerType: (*TestServiceServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "PingEmpty",
- Handler: _TestService_PingEmpty_Handler,
- },
- {
- MethodName: "Ping",
- Handler: _TestService_Ping_Handler,
- },
- {
- MethodName: "PingError",
- Handler: _TestService_PingError_Handler,
- },
- },
- Streams: []grpc.StreamDesc{
- {
- StreamName: "PingList",
- Handler: _TestService_PingList_Handler,
- ServerStreams: true,
- },
- {
- StreamName: "PingStream",
- Handler: _TestService_PingStream_Handler,
- ServerStreams: true,
- ClientStreams: true,
- },
- },
- Metadata: "praefect/grpc-proxy/testdata/test.proto",
-}