github.com/annwntech/go-micro/v2@v2.9.5/service/grpc/proto/test.pb.go (about)

     1  // Code generated by protoc-gen-go. DO NOT EDIT.
     2  // versions:
     3  // 	protoc-gen-go v1.25.0
     4  // 	protoc        v3.13.0
     5  // source: service/grpc/proto/test.proto
     6  
     7  package test
     8  
     9  import (
    10  	context "context"
    11  	proto "github.com/golang/protobuf/proto"
    12  	grpc "google.golang.org/grpc"
    13  	codes "google.golang.org/grpc/codes"
    14  	status "google.golang.org/grpc/status"
    15  	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
    16  	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
    17  	reflect "reflect"
    18  	sync "sync"
    19  )
    20  
    21  const (
    22  	// Verify that this generated code is sufficiently up-to-date.
    23  	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
    24  	// Verify that runtime/protoimpl is sufficiently up-to-date.
    25  	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
    26  )
    27  
    28  // This is a compile-time assertion that a sufficiently up-to-date version
    29  // of the legacy proto package is being used.
    30  const _ = proto.ProtoPackageIsVersion4
    31  
    32  type Request struct {
    33  	state         protoimpl.MessageState
    34  	sizeCache     protoimpl.SizeCache
    35  	unknownFields protoimpl.UnknownFields
    36  
    37  	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
    38  }
    39  
    40  func (x *Request) Reset() {
    41  	*x = Request{}
    42  	if protoimpl.UnsafeEnabled {
    43  		mi := &file_service_grpc_proto_test_proto_msgTypes[0]
    44  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    45  		ms.StoreMessageInfo(mi)
    46  	}
    47  }
    48  
    49  func (x *Request) String() string {
    50  	return protoimpl.X.MessageStringOf(x)
    51  }
    52  
    53  func (*Request) ProtoMessage() {}
    54  
    55  func (x *Request) ProtoReflect() protoreflect.Message {
    56  	mi := &file_service_grpc_proto_test_proto_msgTypes[0]
    57  	if protoimpl.UnsafeEnabled && x != nil {
    58  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    59  		if ms.LoadMessageInfo() == nil {
    60  			ms.StoreMessageInfo(mi)
    61  		}
    62  		return ms
    63  	}
    64  	return mi.MessageOf(x)
    65  }
    66  
    67  // Deprecated: Use Request.ProtoReflect.Descriptor instead.
    68  func (*Request) Descriptor() ([]byte, []int) {
    69  	return file_service_grpc_proto_test_proto_rawDescGZIP(), []int{0}
    70  }
    71  
    72  func (x *Request) GetName() string {
    73  	if x != nil {
    74  		return x.Name
    75  	}
    76  	return ""
    77  }
    78  
    79  type Response struct {
    80  	state         protoimpl.MessageState
    81  	sizeCache     protoimpl.SizeCache
    82  	unknownFields protoimpl.UnknownFields
    83  
    84  	Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
    85  }
    86  
    87  func (x *Response) Reset() {
    88  	*x = Response{}
    89  	if protoimpl.UnsafeEnabled {
    90  		mi := &file_service_grpc_proto_test_proto_msgTypes[1]
    91  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    92  		ms.StoreMessageInfo(mi)
    93  	}
    94  }
    95  
    96  func (x *Response) String() string {
    97  	return protoimpl.X.MessageStringOf(x)
    98  }
    99  
   100  func (*Response) ProtoMessage() {}
   101  
   102  func (x *Response) ProtoReflect() protoreflect.Message {
   103  	mi := &file_service_grpc_proto_test_proto_msgTypes[1]
   104  	if protoimpl.UnsafeEnabled && x != nil {
   105  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   106  		if ms.LoadMessageInfo() == nil {
   107  			ms.StoreMessageInfo(mi)
   108  		}
   109  		return ms
   110  	}
   111  	return mi.MessageOf(x)
   112  }
   113  
   114  // Deprecated: Use Response.ProtoReflect.Descriptor instead.
   115  func (*Response) Descriptor() ([]byte, []int) {
   116  	return file_service_grpc_proto_test_proto_rawDescGZIP(), []int{1}
   117  }
   118  
   119  func (x *Response) GetMsg() string {
   120  	if x != nil {
   121  		return x.Msg
   122  	}
   123  	return ""
   124  }
   125  
   126  var File_service_grpc_proto_test_proto protoreflect.FileDescriptor
   127  
   128  var file_service_grpc_proto_test_proto_rawDesc = []byte{
   129  	0x0a, 0x1d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70,
   130  	0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
   131  	0x1d, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
   132  	0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x1c,
   133  	0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73,
   134  	0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x32, 0x25, 0x0a, 0x04,
   135  	0x54, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x08, 0x2e, 0x52,
   136  	0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x09, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
   137  	0x65, 0x22, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
   138  }
   139  
   140  var (
   141  	file_service_grpc_proto_test_proto_rawDescOnce sync.Once
   142  	file_service_grpc_proto_test_proto_rawDescData = file_service_grpc_proto_test_proto_rawDesc
   143  )
   144  
   145  func file_service_grpc_proto_test_proto_rawDescGZIP() []byte {
   146  	file_service_grpc_proto_test_proto_rawDescOnce.Do(func() {
   147  		file_service_grpc_proto_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_grpc_proto_test_proto_rawDescData)
   148  	})
   149  	return file_service_grpc_proto_test_proto_rawDescData
   150  }
   151  
   152  var file_service_grpc_proto_test_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
   153  var file_service_grpc_proto_test_proto_goTypes = []interface{}{
   154  	(*Request)(nil),  // 0: Request
   155  	(*Response)(nil), // 1: Response
   156  }
   157  var file_service_grpc_proto_test_proto_depIdxs = []int32{
   158  	0, // 0: Test.Call:input_type -> Request
   159  	1, // 1: Test.Call:output_type -> Response
   160  	1, // [1:2] is the sub-list for method output_type
   161  	0, // [0:1] is the sub-list for method input_type
   162  	0, // [0:0] is the sub-list for extension type_name
   163  	0, // [0:0] is the sub-list for extension extendee
   164  	0, // [0:0] is the sub-list for field type_name
   165  }
   166  
   167  func init() { file_service_grpc_proto_test_proto_init() }
   168  func file_service_grpc_proto_test_proto_init() {
   169  	if File_service_grpc_proto_test_proto != nil {
   170  		return
   171  	}
   172  	if !protoimpl.UnsafeEnabled {
   173  		file_service_grpc_proto_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
   174  			switch v := v.(*Request); i {
   175  			case 0:
   176  				return &v.state
   177  			case 1:
   178  				return &v.sizeCache
   179  			case 2:
   180  				return &v.unknownFields
   181  			default:
   182  				return nil
   183  			}
   184  		}
   185  		file_service_grpc_proto_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
   186  			switch v := v.(*Response); i {
   187  			case 0:
   188  				return &v.state
   189  			case 1:
   190  				return &v.sizeCache
   191  			case 2:
   192  				return &v.unknownFields
   193  			default:
   194  				return nil
   195  			}
   196  		}
   197  	}
   198  	type x struct{}
   199  	out := protoimpl.TypeBuilder{
   200  		File: protoimpl.DescBuilder{
   201  			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
   202  			RawDescriptor: file_service_grpc_proto_test_proto_rawDesc,
   203  			NumEnums:      0,
   204  			NumMessages:   2,
   205  			NumExtensions: 0,
   206  			NumServices:   1,
   207  		},
   208  		GoTypes:           file_service_grpc_proto_test_proto_goTypes,
   209  		DependencyIndexes: file_service_grpc_proto_test_proto_depIdxs,
   210  		MessageInfos:      file_service_grpc_proto_test_proto_msgTypes,
   211  	}.Build()
   212  	File_service_grpc_proto_test_proto = out.File
   213  	file_service_grpc_proto_test_proto_rawDesc = nil
   214  	file_service_grpc_proto_test_proto_goTypes = nil
   215  	file_service_grpc_proto_test_proto_depIdxs = nil
   216  }
   217  
   218  // Reference imports to suppress errors if they are not otherwise used.
   219  var _ context.Context
   220  var _ grpc.ClientConnInterface
   221  
   222  // This is a compile-time assertion to ensure that this generated file
   223  // is compatible with the grpc package it is being compiled against.
   224  const _ = grpc.SupportPackageIsVersion6
   225  
   226  // TestClient is the client API for Test service.
   227  //
   228  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
   229  type TestClient interface {
   230  	Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
   231  }
   232  
   233  type testClient struct {
   234  	cc grpc.ClientConnInterface
   235  }
   236  
   237  func NewTestClient(cc grpc.ClientConnInterface) TestClient {
   238  	return &testClient{cc}
   239  }
   240  
   241  func (c *testClient) Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
   242  	out := new(Response)
   243  	err := c.cc.Invoke(ctx, "/Test/Call", in, out, opts...)
   244  	if err != nil {
   245  		return nil, err
   246  	}
   247  	return out, nil
   248  }
   249  
   250  // TestServer is the server API for Test service.
   251  type TestServer interface {
   252  	Call(context.Context, *Request) (*Response, error)
   253  }
   254  
   255  // UnimplementedTestServer can be embedded to have forward compatible implementations.
   256  type UnimplementedTestServer struct {
   257  }
   258  
   259  func (*UnimplementedTestServer) Call(context.Context, *Request) (*Response, error) {
   260  	return nil, status.Errorf(codes.Unimplemented, "method Call not implemented")
   261  }
   262  
   263  func RegisterTestServer(s *grpc.Server, srv TestServer) {
   264  	s.RegisterService(&_Test_serviceDesc, srv)
   265  }
   266  
   267  func _Test_Call_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   268  	in := new(Request)
   269  	if err := dec(in); err != nil {
   270  		return nil, err
   271  	}
   272  	if interceptor == nil {
   273  		return srv.(TestServer).Call(ctx, in)
   274  	}
   275  	info := &grpc.UnaryServerInfo{
   276  		Server:     srv,
   277  		FullMethod: "/Test/Call",
   278  	}
   279  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   280  		return srv.(TestServer).Call(ctx, req.(*Request))
   281  	}
   282  	return interceptor(ctx, in, info, handler)
   283  }
   284  
   285  var _Test_serviceDesc = grpc.ServiceDesc{
   286  	ServiceName: "Test",
   287  	HandlerType: (*TestServer)(nil),
   288  	Methods: []grpc.MethodDesc{
   289  		{
   290  			MethodName: "Call",
   291  			Handler:    _Test_Call_Handler,
   292  		},
   293  	},
   294  	Streams:  []grpc.StreamDesc{},
   295  	Metadata: "service/grpc/proto/test.proto",
   296  }