github.com/annwntech/go-micro/v2@v2.9.5/server/proto/server.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: server/proto/server.proto 6 7 package go_micro_server 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 HandleRequest struct { 33 state protoimpl.MessageState 34 sizeCache protoimpl.SizeCache 35 unknownFields protoimpl.UnknownFields 36 37 Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` 38 Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` 39 Protocol string `protobuf:"bytes,3,opt,name=protocol,proto3" json:"protocol,omitempty"` 40 } 41 42 func (x *HandleRequest) Reset() { 43 *x = HandleRequest{} 44 if protoimpl.UnsafeEnabled { 45 mi := &file_server_proto_server_proto_msgTypes[0] 46 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 47 ms.StoreMessageInfo(mi) 48 } 49 } 50 51 func (x *HandleRequest) String() string { 52 return protoimpl.X.MessageStringOf(x) 53 } 54 55 func (*HandleRequest) ProtoMessage() {} 56 57 func (x *HandleRequest) ProtoReflect() protoreflect.Message { 58 mi := &file_server_proto_server_proto_msgTypes[0] 59 if protoimpl.UnsafeEnabled && x != nil { 60 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 61 if ms.LoadMessageInfo() == nil { 62 ms.StoreMessageInfo(mi) 63 } 64 return ms 65 } 66 return mi.MessageOf(x) 67 } 68 69 // Deprecated: Use HandleRequest.ProtoReflect.Descriptor instead. 70 func (*HandleRequest) Descriptor() ([]byte, []int) { 71 return file_server_proto_server_proto_rawDescGZIP(), []int{0} 72 } 73 74 func (x *HandleRequest) GetService() string { 75 if x != nil { 76 return x.Service 77 } 78 return "" 79 } 80 81 func (x *HandleRequest) GetEndpoint() string { 82 if x != nil { 83 return x.Endpoint 84 } 85 return "" 86 } 87 88 func (x *HandleRequest) GetProtocol() string { 89 if x != nil { 90 return x.Protocol 91 } 92 return "" 93 } 94 95 type HandleResponse struct { 96 state protoimpl.MessageState 97 sizeCache protoimpl.SizeCache 98 unknownFields protoimpl.UnknownFields 99 } 100 101 func (x *HandleResponse) Reset() { 102 *x = HandleResponse{} 103 if protoimpl.UnsafeEnabled { 104 mi := &file_server_proto_server_proto_msgTypes[1] 105 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 106 ms.StoreMessageInfo(mi) 107 } 108 } 109 110 func (x *HandleResponse) String() string { 111 return protoimpl.X.MessageStringOf(x) 112 } 113 114 func (*HandleResponse) ProtoMessage() {} 115 116 func (x *HandleResponse) ProtoReflect() protoreflect.Message { 117 mi := &file_server_proto_server_proto_msgTypes[1] 118 if protoimpl.UnsafeEnabled && x != nil { 119 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 120 if ms.LoadMessageInfo() == nil { 121 ms.StoreMessageInfo(mi) 122 } 123 return ms 124 } 125 return mi.MessageOf(x) 126 } 127 128 // Deprecated: Use HandleResponse.ProtoReflect.Descriptor instead. 129 func (*HandleResponse) Descriptor() ([]byte, []int) { 130 return file_server_proto_server_proto_rawDescGZIP(), []int{1} 131 } 132 133 type SubscribeRequest struct { 134 state protoimpl.MessageState 135 sizeCache protoimpl.SizeCache 136 unknownFields protoimpl.UnknownFields 137 138 Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` 139 } 140 141 func (x *SubscribeRequest) Reset() { 142 *x = SubscribeRequest{} 143 if protoimpl.UnsafeEnabled { 144 mi := &file_server_proto_server_proto_msgTypes[2] 145 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 146 ms.StoreMessageInfo(mi) 147 } 148 } 149 150 func (x *SubscribeRequest) String() string { 151 return protoimpl.X.MessageStringOf(x) 152 } 153 154 func (*SubscribeRequest) ProtoMessage() {} 155 156 func (x *SubscribeRequest) ProtoReflect() protoreflect.Message { 157 mi := &file_server_proto_server_proto_msgTypes[2] 158 if protoimpl.UnsafeEnabled && x != nil { 159 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 160 if ms.LoadMessageInfo() == nil { 161 ms.StoreMessageInfo(mi) 162 } 163 return ms 164 } 165 return mi.MessageOf(x) 166 } 167 168 // Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead. 169 func (*SubscribeRequest) Descriptor() ([]byte, []int) { 170 return file_server_proto_server_proto_rawDescGZIP(), []int{2} 171 } 172 173 func (x *SubscribeRequest) GetTopic() string { 174 if x != nil { 175 return x.Topic 176 } 177 return "" 178 } 179 180 type SubscribeResponse struct { 181 state protoimpl.MessageState 182 sizeCache protoimpl.SizeCache 183 unknownFields protoimpl.UnknownFields 184 } 185 186 func (x *SubscribeResponse) Reset() { 187 *x = SubscribeResponse{} 188 if protoimpl.UnsafeEnabled { 189 mi := &file_server_proto_server_proto_msgTypes[3] 190 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 191 ms.StoreMessageInfo(mi) 192 } 193 } 194 195 func (x *SubscribeResponse) String() string { 196 return protoimpl.X.MessageStringOf(x) 197 } 198 199 func (*SubscribeResponse) ProtoMessage() {} 200 201 func (x *SubscribeResponse) ProtoReflect() protoreflect.Message { 202 mi := &file_server_proto_server_proto_msgTypes[3] 203 if protoimpl.UnsafeEnabled && x != nil { 204 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 205 if ms.LoadMessageInfo() == nil { 206 ms.StoreMessageInfo(mi) 207 } 208 return ms 209 } 210 return mi.MessageOf(x) 211 } 212 213 // Deprecated: Use SubscribeResponse.ProtoReflect.Descriptor instead. 214 func (*SubscribeResponse) Descriptor() ([]byte, []int) { 215 return file_server_proto_server_proto_rawDescGZIP(), []int{3} 216 } 217 218 var File_server_proto_server_proto protoreflect.FileDescriptor 219 220 var file_server_proto_server_proto_rawDesc = []byte{ 221 0x0a, 0x19, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 222 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x67, 0x6f, 0x2e, 223 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x61, 0x0a, 0x0d, 224 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 225 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 226 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 227 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 228 0x69, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 229 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22, 230 0x10, 0x0a, 0x0e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 231 0x65, 0x22, 0x28, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 232 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x01, 233 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x22, 0x13, 0x0a, 0x11, 0x53, 234 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 235 0x32, 0xab, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x06, 0x48, 236 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 237 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 238 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 239 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 240 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 241 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x21, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 242 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 243 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 244 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 245 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x62, 0x06, 246 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 247 } 248 249 var ( 250 file_server_proto_server_proto_rawDescOnce sync.Once 251 file_server_proto_server_proto_rawDescData = file_server_proto_server_proto_rawDesc 252 ) 253 254 func file_server_proto_server_proto_rawDescGZIP() []byte { 255 file_server_proto_server_proto_rawDescOnce.Do(func() { 256 file_server_proto_server_proto_rawDescData = protoimpl.X.CompressGZIP(file_server_proto_server_proto_rawDescData) 257 }) 258 return file_server_proto_server_proto_rawDescData 259 } 260 261 var file_server_proto_server_proto_msgTypes = make([]protoimpl.MessageInfo, 4) 262 var file_server_proto_server_proto_goTypes = []interface{}{ 263 (*HandleRequest)(nil), // 0: go.micro.server.HandleRequest 264 (*HandleResponse)(nil), // 1: go.micro.server.HandleResponse 265 (*SubscribeRequest)(nil), // 2: go.micro.server.SubscribeRequest 266 (*SubscribeResponse)(nil), // 3: go.micro.server.SubscribeResponse 267 } 268 var file_server_proto_server_proto_depIdxs = []int32{ 269 0, // 0: go.micro.server.Server.Handle:input_type -> go.micro.server.HandleRequest 270 2, // 1: go.micro.server.Server.Subscribe:input_type -> go.micro.server.SubscribeRequest 271 1, // 2: go.micro.server.Server.Handle:output_type -> go.micro.server.HandleResponse 272 3, // 3: go.micro.server.Server.Subscribe:output_type -> go.micro.server.SubscribeResponse 273 2, // [2:4] is the sub-list for method output_type 274 0, // [0:2] is the sub-list for method input_type 275 0, // [0:0] is the sub-list for extension type_name 276 0, // [0:0] is the sub-list for extension extendee 277 0, // [0:0] is the sub-list for field type_name 278 } 279 280 func init() { file_server_proto_server_proto_init() } 281 func file_server_proto_server_proto_init() { 282 if File_server_proto_server_proto != nil { 283 return 284 } 285 if !protoimpl.UnsafeEnabled { 286 file_server_proto_server_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 287 switch v := v.(*HandleRequest); i { 288 case 0: 289 return &v.state 290 case 1: 291 return &v.sizeCache 292 case 2: 293 return &v.unknownFields 294 default: 295 return nil 296 } 297 } 298 file_server_proto_server_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 299 switch v := v.(*HandleResponse); i { 300 case 0: 301 return &v.state 302 case 1: 303 return &v.sizeCache 304 case 2: 305 return &v.unknownFields 306 default: 307 return nil 308 } 309 } 310 file_server_proto_server_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { 311 switch v := v.(*SubscribeRequest); i { 312 case 0: 313 return &v.state 314 case 1: 315 return &v.sizeCache 316 case 2: 317 return &v.unknownFields 318 default: 319 return nil 320 } 321 } 322 file_server_proto_server_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { 323 switch v := v.(*SubscribeResponse); i { 324 case 0: 325 return &v.state 326 case 1: 327 return &v.sizeCache 328 case 2: 329 return &v.unknownFields 330 default: 331 return nil 332 } 333 } 334 } 335 type x struct{} 336 out := protoimpl.TypeBuilder{ 337 File: protoimpl.DescBuilder{ 338 GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 339 RawDescriptor: file_server_proto_server_proto_rawDesc, 340 NumEnums: 0, 341 NumMessages: 4, 342 NumExtensions: 0, 343 NumServices: 1, 344 }, 345 GoTypes: file_server_proto_server_proto_goTypes, 346 DependencyIndexes: file_server_proto_server_proto_depIdxs, 347 MessageInfos: file_server_proto_server_proto_msgTypes, 348 }.Build() 349 File_server_proto_server_proto = out.File 350 file_server_proto_server_proto_rawDesc = nil 351 file_server_proto_server_proto_goTypes = nil 352 file_server_proto_server_proto_depIdxs = nil 353 } 354 355 // Reference imports to suppress errors if they are not otherwise used. 356 var _ context.Context 357 var _ grpc.ClientConnInterface 358 359 // This is a compile-time assertion to ensure that this generated file 360 // is compatible with the grpc package it is being compiled against. 361 const _ = grpc.SupportPackageIsVersion6 362 363 // ServerClient is the client API for Server service. 364 // 365 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 366 type ServerClient interface { 367 Handle(ctx context.Context, in *HandleRequest, opts ...grpc.CallOption) (*HandleResponse, error) 368 Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (*SubscribeResponse, error) 369 } 370 371 type serverClient struct { 372 cc grpc.ClientConnInterface 373 } 374 375 func NewServerClient(cc grpc.ClientConnInterface) ServerClient { 376 return &serverClient{cc} 377 } 378 379 func (c *serverClient) Handle(ctx context.Context, in *HandleRequest, opts ...grpc.CallOption) (*HandleResponse, error) { 380 out := new(HandleResponse) 381 err := c.cc.Invoke(ctx, "/go.micro.server.Server/Handle", in, out, opts...) 382 if err != nil { 383 return nil, err 384 } 385 return out, nil 386 } 387 388 func (c *serverClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (*SubscribeResponse, error) { 389 out := new(SubscribeResponse) 390 err := c.cc.Invoke(ctx, "/go.micro.server.Server/Subscribe", in, out, opts...) 391 if err != nil { 392 return nil, err 393 } 394 return out, nil 395 } 396 397 // ServerServer is the server API for Server service. 398 type ServerServer interface { 399 Handle(context.Context, *HandleRequest) (*HandleResponse, error) 400 Subscribe(context.Context, *SubscribeRequest) (*SubscribeResponse, error) 401 } 402 403 // UnimplementedServerServer can be embedded to have forward compatible implementations. 404 type UnimplementedServerServer struct { 405 } 406 407 func (*UnimplementedServerServer) Handle(context.Context, *HandleRequest) (*HandleResponse, error) { 408 return nil, status.Errorf(codes.Unimplemented, "method Handle not implemented") 409 } 410 func (*UnimplementedServerServer) Subscribe(context.Context, *SubscribeRequest) (*SubscribeResponse, error) { 411 return nil, status.Errorf(codes.Unimplemented, "method Subscribe not implemented") 412 } 413 414 func RegisterServerServer(s *grpc.Server, srv ServerServer) { 415 s.RegisterService(&_Server_serviceDesc, srv) 416 } 417 418 func _Server_Handle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 419 in := new(HandleRequest) 420 if err := dec(in); err != nil { 421 return nil, err 422 } 423 if interceptor == nil { 424 return srv.(ServerServer).Handle(ctx, in) 425 } 426 info := &grpc.UnaryServerInfo{ 427 Server: srv, 428 FullMethod: "/go.micro.server.Server/Handle", 429 } 430 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 431 return srv.(ServerServer).Handle(ctx, req.(*HandleRequest)) 432 } 433 return interceptor(ctx, in, info, handler) 434 } 435 436 func _Server_Subscribe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 437 in := new(SubscribeRequest) 438 if err := dec(in); err != nil { 439 return nil, err 440 } 441 if interceptor == nil { 442 return srv.(ServerServer).Subscribe(ctx, in) 443 } 444 info := &grpc.UnaryServerInfo{ 445 Server: srv, 446 FullMethod: "/go.micro.server.Server/Subscribe", 447 } 448 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 449 return srv.(ServerServer).Subscribe(ctx, req.(*SubscribeRequest)) 450 } 451 return interceptor(ctx, in, info, handler) 452 } 453 454 var _Server_serviceDesc = grpc.ServiceDesc{ 455 ServiceName: "go.micro.server.Server", 456 HandlerType: (*ServerServer)(nil), 457 Methods: []grpc.MethodDesc{ 458 { 459 MethodName: "Handle", 460 Handler: _Server_Handle_Handler, 461 }, 462 { 463 MethodName: "Subscribe", 464 Handler: _Server_Subscribe_Handler, 465 }, 466 }, 467 Streams: []grpc.StreamDesc{}, 468 Metadata: "server/proto/server.proto", 469 }