go.uber.org/yarpc@v1.72.1/encoding/protobuf/internal/testpb/v2/test.pb.go (about)

     1  // Code generated by protoc-gen-go. DO NOT EDIT.
     2  // versions:
     3  // 	protoc-gen-go v1.26.0
     4  // 	protoc        v3.5.1
     5  // source: encoding/protobuf/internal/testpb/v2/test.proto
     6  
     7  // Copyright (c) 2022 Uber Technologies, Inc.
     8  //
     9  // Permission is hereby granted, free of charge, to any person obtaining a copy
    10  // of this software and associated documentation files (the "Software"), to deal
    11  // in the Software without restriction, including without limitation the rights
    12  // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    13  // copies of the Software, and to permit persons to whom the Software is
    14  // furnished to do so, subject to the following conditions:
    15  //
    16  // The above copyright notice and this permission notice shall be included in
    17  // all copies or substantial portions of the Software.
    18  //
    19  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    20  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    21  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    22  // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    23  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    24  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    25  // THE SOFTWARE.
    26  
    27  package testpb
    28  
    29  import (
    30  	context "context"
    31  	grpc "google.golang.org/grpc"
    32  	codes "google.golang.org/grpc/codes"
    33  	status "google.golang.org/grpc/status"
    34  	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
    35  	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
    36  	reflect "reflect"
    37  	sync "sync"
    38  )
    39  
    40  const (
    41  	// Verify that this generated code is sufficiently up-to-date.
    42  	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
    43  	// Verify that runtime/protoimpl is sufficiently up-to-date.
    44  	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
    45  )
    46  
    47  type TestMessage struct {
    48  	state         protoimpl.MessageState
    49  	sizeCache     protoimpl.SizeCache
    50  	unknownFields protoimpl.UnknownFields
    51  
    52  	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
    53  }
    54  
    55  func (x *TestMessage) Reset() {
    56  	*x = TestMessage{}
    57  	if protoimpl.UnsafeEnabled {
    58  		mi := &file_encoding_protobuf_internal_testpb_v2_test_proto_msgTypes[0]
    59  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    60  		ms.StoreMessageInfo(mi)
    61  	}
    62  }
    63  
    64  func (x *TestMessage) String() string {
    65  	return protoimpl.X.MessageStringOf(x)
    66  }
    67  
    68  func (*TestMessage) ProtoMessage() {}
    69  
    70  func (x *TestMessage) ProtoReflect() protoreflect.Message {
    71  	mi := &file_encoding_protobuf_internal_testpb_v2_test_proto_msgTypes[0]
    72  	if protoimpl.UnsafeEnabled && x != nil {
    73  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    74  		if ms.LoadMessageInfo() == nil {
    75  			ms.StoreMessageInfo(mi)
    76  		}
    77  		return ms
    78  	}
    79  	return mi.MessageOf(x)
    80  }
    81  
    82  // Deprecated: Use TestMessage.ProtoReflect.Descriptor instead.
    83  func (*TestMessage) Descriptor() ([]byte, []int) {
    84  	return file_encoding_protobuf_internal_testpb_v2_test_proto_rawDescGZIP(), []int{0}
    85  }
    86  
    87  func (x *TestMessage) GetValue() string {
    88  	if x != nil {
    89  		return x.Value
    90  	}
    91  	return ""
    92  }
    93  
    94  var File_encoding_protobuf_internal_testpb_v2_test_proto protoreflect.FileDescriptor
    95  
    96  var file_encoding_protobuf_internal_testpb_v2_test_proto_rawDesc = []byte{
    97  	0x0a, 0x2f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
    98  	0x62, 0x75, 0x66, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73,
    99  	0x74, 0x70, 0x62, 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74,
   100  	0x6f, 0x12, 0x1c, 0x75, 0x62, 0x65, 0x72, 0x2e, 0x79, 0x61, 0x72, 0x70, 0x63, 0x2e, 0x65, 0x6e,
   101  	0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22,
   102  	0x23, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14,
   103  	0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76,
   104  	0x61, 0x6c, 0x75, 0x65, 0x32, 0xc9, 0x01, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x5d, 0x0a,
   105  	0x05, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x29, 0x2e, 0x75, 0x62, 0x65, 0x72, 0x2e, 0x79, 0x61,
   106  	0x72, 0x70, 0x63, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f,
   107  	0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
   108  	0x65, 0x1a, 0x29, 0x2e, 0x75, 0x62, 0x65, 0x72, 0x2e, 0x79, 0x61, 0x72, 0x70, 0x63, 0x2e, 0x65,
   109  	0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
   110  	0x2e, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x62, 0x0a, 0x06,
   111  	0x44, 0x75, 0x70, 0x6c, 0x65, 0x78, 0x12, 0x29, 0x2e, 0x75, 0x62, 0x65, 0x72, 0x2e, 0x79, 0x61,
   112  	0x72, 0x70, 0x63, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f,
   113  	0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
   114  	0x65, 0x1a, 0x29, 0x2e, 0x75, 0x62, 0x65, 0x72, 0x2e, 0x79, 0x61, 0x72, 0x70, 0x63, 0x2e, 0x65,
   115  	0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
   116  	0x2e, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, 0x01, 0x30, 0x01,
   117  	0x42, 0x2d, 0x5a, 0x2b, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f,
   118  	0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74,
   119  	0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x76, 0x32, 0x3b, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62,
   120  	0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
   121  }
   122  
   123  var (
   124  	file_encoding_protobuf_internal_testpb_v2_test_proto_rawDescOnce sync.Once
   125  	file_encoding_protobuf_internal_testpb_v2_test_proto_rawDescData = file_encoding_protobuf_internal_testpb_v2_test_proto_rawDesc
   126  )
   127  
   128  func file_encoding_protobuf_internal_testpb_v2_test_proto_rawDescGZIP() []byte {
   129  	file_encoding_protobuf_internal_testpb_v2_test_proto_rawDescOnce.Do(func() {
   130  		file_encoding_protobuf_internal_testpb_v2_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_encoding_protobuf_internal_testpb_v2_test_proto_rawDescData)
   131  	})
   132  	return file_encoding_protobuf_internal_testpb_v2_test_proto_rawDescData
   133  }
   134  
   135  var file_encoding_protobuf_internal_testpb_v2_test_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
   136  var file_encoding_protobuf_internal_testpb_v2_test_proto_goTypes = []interface{}{
   137  	(*TestMessage)(nil), // 0: uber.yarpc.encoding.protobuf.TestMessage
   138  }
   139  var file_encoding_protobuf_internal_testpb_v2_test_proto_depIdxs = []int32{
   140  	0, // 0: uber.yarpc.encoding.protobuf.Test.Unary:input_type -> uber.yarpc.encoding.protobuf.TestMessage
   141  	0, // 1: uber.yarpc.encoding.protobuf.Test.Duplex:input_type -> uber.yarpc.encoding.protobuf.TestMessage
   142  	0, // 2: uber.yarpc.encoding.protobuf.Test.Unary:output_type -> uber.yarpc.encoding.protobuf.TestMessage
   143  	0, // 3: uber.yarpc.encoding.protobuf.Test.Duplex:output_type -> uber.yarpc.encoding.protobuf.TestMessage
   144  	2, // [2:4] is the sub-list for method output_type
   145  	0, // [0:2] is the sub-list for method input_type
   146  	0, // [0:0] is the sub-list for extension type_name
   147  	0, // [0:0] is the sub-list for extension extendee
   148  	0, // [0:0] is the sub-list for field type_name
   149  }
   150  
   151  func init() { file_encoding_protobuf_internal_testpb_v2_test_proto_init() }
   152  func file_encoding_protobuf_internal_testpb_v2_test_proto_init() {
   153  	if File_encoding_protobuf_internal_testpb_v2_test_proto != nil {
   154  		return
   155  	}
   156  	if !protoimpl.UnsafeEnabled {
   157  		file_encoding_protobuf_internal_testpb_v2_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
   158  			switch v := v.(*TestMessage); i {
   159  			case 0:
   160  				return &v.state
   161  			case 1:
   162  				return &v.sizeCache
   163  			case 2:
   164  				return &v.unknownFields
   165  			default:
   166  				return nil
   167  			}
   168  		}
   169  	}
   170  	type x struct{}
   171  	out := protoimpl.TypeBuilder{
   172  		File: protoimpl.DescBuilder{
   173  			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
   174  			RawDescriptor: file_encoding_protobuf_internal_testpb_v2_test_proto_rawDesc,
   175  			NumEnums:      0,
   176  			NumMessages:   1,
   177  			NumExtensions: 0,
   178  			NumServices:   1,
   179  		},
   180  		GoTypes:           file_encoding_protobuf_internal_testpb_v2_test_proto_goTypes,
   181  		DependencyIndexes: file_encoding_protobuf_internal_testpb_v2_test_proto_depIdxs,
   182  		MessageInfos:      file_encoding_protobuf_internal_testpb_v2_test_proto_msgTypes,
   183  	}.Build()
   184  	File_encoding_protobuf_internal_testpb_v2_test_proto = out.File
   185  	file_encoding_protobuf_internal_testpb_v2_test_proto_rawDesc = nil
   186  	file_encoding_protobuf_internal_testpb_v2_test_proto_goTypes = nil
   187  	file_encoding_protobuf_internal_testpb_v2_test_proto_depIdxs = nil
   188  }
   189  
   190  // Reference imports to suppress errors if they are not otherwise used.
   191  var _ context.Context
   192  var _ grpc.ClientConnInterface
   193  
   194  // This is a compile-time assertion to ensure that this generated file
   195  // is compatible with the grpc package it is being compiled against.
   196  const _ = grpc.SupportPackageIsVersion6
   197  
   198  // TestClient is the client API for Test service.
   199  //
   200  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
   201  type TestClient interface {
   202  	Unary(ctx context.Context, in *TestMessage, opts ...grpc.CallOption) (*TestMessage, error)
   203  	Duplex(ctx context.Context, opts ...grpc.CallOption) (Test_DuplexClient, error)
   204  }
   205  
   206  type testClient struct {
   207  	cc grpc.ClientConnInterface
   208  }
   209  
   210  func NewTestClient(cc grpc.ClientConnInterface) TestClient {
   211  	return &testClient{cc}
   212  }
   213  
   214  func (c *testClient) Unary(ctx context.Context, in *TestMessage, opts ...grpc.CallOption) (*TestMessage, error) {
   215  	out := new(TestMessage)
   216  	err := c.cc.Invoke(ctx, "/uber.yarpc.encoding.protobuf.Test/Unary", in, out, opts...)
   217  	if err != nil {
   218  		return nil, err
   219  	}
   220  	return out, nil
   221  }
   222  
   223  func (c *testClient) Duplex(ctx context.Context, opts ...grpc.CallOption) (Test_DuplexClient, error) {
   224  	stream, err := c.cc.NewStream(ctx, &_Test_serviceDesc.Streams[0], "/uber.yarpc.encoding.protobuf.Test/Duplex", opts...)
   225  	if err != nil {
   226  		return nil, err
   227  	}
   228  	x := &testDuplexClient{stream}
   229  	return x, nil
   230  }
   231  
   232  type Test_DuplexClient interface {
   233  	Send(*TestMessage) error
   234  	Recv() (*TestMessage, error)
   235  	grpc.ClientStream
   236  }
   237  
   238  type testDuplexClient struct {
   239  	grpc.ClientStream
   240  }
   241  
   242  func (x *testDuplexClient) Send(m *TestMessage) error {
   243  	return x.ClientStream.SendMsg(m)
   244  }
   245  
   246  func (x *testDuplexClient) Recv() (*TestMessage, error) {
   247  	m := new(TestMessage)
   248  	if err := x.ClientStream.RecvMsg(m); err != nil {
   249  		return nil, err
   250  	}
   251  	return m, nil
   252  }
   253  
   254  // TestServer is the server API for Test service.
   255  type TestServer interface {
   256  	Unary(context.Context, *TestMessage) (*TestMessage, error)
   257  	Duplex(Test_DuplexServer) error
   258  }
   259  
   260  // UnimplementedTestServer can be embedded to have forward compatible implementations.
   261  type UnimplementedTestServer struct {
   262  }
   263  
   264  func (*UnimplementedTestServer) Unary(context.Context, *TestMessage) (*TestMessage, error) {
   265  	return nil, status.Errorf(codes.Unimplemented, "method Unary not implemented")
   266  }
   267  func (*UnimplementedTestServer) Duplex(Test_DuplexServer) error {
   268  	return status.Errorf(codes.Unimplemented, "method Duplex not implemented")
   269  }
   270  
   271  func RegisterTestServer(s *grpc.Server, srv TestServer) {
   272  	s.RegisterService(&_Test_serviceDesc, srv)
   273  }
   274  
   275  func _Test_Unary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   276  	in := new(TestMessage)
   277  	if err := dec(in); err != nil {
   278  		return nil, err
   279  	}
   280  	if interceptor == nil {
   281  		return srv.(TestServer).Unary(ctx, in)
   282  	}
   283  	info := &grpc.UnaryServerInfo{
   284  		Server:     srv,
   285  		FullMethod: "/uber.yarpc.encoding.protobuf.Test/Unary",
   286  	}
   287  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   288  		return srv.(TestServer).Unary(ctx, req.(*TestMessage))
   289  	}
   290  	return interceptor(ctx, in, info, handler)
   291  }
   292  
   293  func _Test_Duplex_Handler(srv interface{}, stream grpc.ServerStream) error {
   294  	return srv.(TestServer).Duplex(&testDuplexServer{stream})
   295  }
   296  
   297  type Test_DuplexServer interface {
   298  	Send(*TestMessage) error
   299  	Recv() (*TestMessage, error)
   300  	grpc.ServerStream
   301  }
   302  
   303  type testDuplexServer struct {
   304  	grpc.ServerStream
   305  }
   306  
   307  func (x *testDuplexServer) Send(m *TestMessage) error {
   308  	return x.ServerStream.SendMsg(m)
   309  }
   310  
   311  func (x *testDuplexServer) Recv() (*TestMessage, error) {
   312  	m := new(TestMessage)
   313  	if err := x.ServerStream.RecvMsg(m); err != nil {
   314  		return nil, err
   315  	}
   316  	return m, nil
   317  }
   318  
   319  var _Test_serviceDesc = grpc.ServiceDesc{
   320  	ServiceName: "uber.yarpc.encoding.protobuf.Test",
   321  	HandlerType: (*TestServer)(nil),
   322  	Methods: []grpc.MethodDesc{
   323  		{
   324  			MethodName: "Unary",
   325  			Handler:    _Test_Unary_Handler,
   326  		},
   327  	},
   328  	Streams: []grpc.StreamDesc{
   329  		{
   330  			StreamName:    "Duplex",
   331  			Handler:       _Test_Duplex_Handler,
   332  			ServerStreams: true,
   333  			ClientStreams: true,
   334  		},
   335  	},
   336  	Metadata: "encoding/protobuf/internal/testpb/v2/test.proto",
   337  }