github.com/Asutorufa/yuhaiin@v0.3.6-0.20240502055049-7984da7023a0/pkg/protos/node/grpc/node_grpc.pb.go (about) 1 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 // versions: 3 // - protoc-gen-go-grpc v1.3.0 4 // - protoc v4.25.3 5 // source: node/grpc/node.proto 6 7 package service 8 9 import ( 10 context "context" 11 node "github.com/Asutorufa/yuhaiin/pkg/protos/node" 12 latency "github.com/Asutorufa/yuhaiin/pkg/protos/node/latency" 13 point "github.com/Asutorufa/yuhaiin/pkg/protos/node/point" 14 grpc "google.golang.org/grpc" 15 codes "google.golang.org/grpc/codes" 16 status "google.golang.org/grpc/status" 17 emptypb "google.golang.org/protobuf/types/known/emptypb" 18 wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" 19 ) 20 21 // This is a compile-time assertion to ensure that this generated file 22 // is compatible with the grpc package it is being compiled against. 23 // Requires gRPC-Go v1.32.0 or later. 24 const _ = grpc.SupportPackageIsVersion7 25 26 const ( 27 Node_Now_FullMethodName = "/yuhaiin.protos.node.service.node/now" 28 Node_Use_FullMethodName = "/yuhaiin.protos.node.service.node/use" 29 Node_Get_FullMethodName = "/yuhaiin.protos.node.service.node/get" 30 Node_Save_FullMethodName = "/yuhaiin.protos.node.service.node/save" 31 Node_Remove_FullMethodName = "/yuhaiin.protos.node.service.node/remove" 32 Node_Manager_FullMethodName = "/yuhaiin.protos.node.service.node/manager" 33 Node_Latency_FullMethodName = "/yuhaiin.protos.node.service.node/latency" 34 ) 35 36 // NodeClient is the client API for Node service. 37 // 38 // 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. 39 type NodeClient interface { 40 Now(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NowResp, error) 41 // use req is hash string of point 42 Use(ctx context.Context, in *UseReq, opts ...grpc.CallOption) (*point.Point, error) 43 Get(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*point.Point, error) 44 Save(ctx context.Context, in *point.Point, opts ...grpc.CallOption) (*point.Point, error) 45 Remove(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) 46 Manager(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*node.Manager, error) 47 Latency(ctx context.Context, in *latency.Requests, opts ...grpc.CallOption) (*latency.Response, error) 48 } 49 50 type nodeClient struct { 51 cc grpc.ClientConnInterface 52 } 53 54 func NewNodeClient(cc grpc.ClientConnInterface) NodeClient { 55 return &nodeClient{cc} 56 } 57 58 func (c *nodeClient) Now(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NowResp, error) { 59 out := new(NowResp) 60 err := c.cc.Invoke(ctx, Node_Now_FullMethodName, in, out, opts...) 61 if err != nil { 62 return nil, err 63 } 64 return out, nil 65 } 66 67 func (c *nodeClient) Use(ctx context.Context, in *UseReq, opts ...grpc.CallOption) (*point.Point, error) { 68 out := new(point.Point) 69 err := c.cc.Invoke(ctx, Node_Use_FullMethodName, in, out, opts...) 70 if err != nil { 71 return nil, err 72 } 73 return out, nil 74 } 75 76 func (c *nodeClient) Get(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*point.Point, error) { 77 out := new(point.Point) 78 err := c.cc.Invoke(ctx, Node_Get_FullMethodName, in, out, opts...) 79 if err != nil { 80 return nil, err 81 } 82 return out, nil 83 } 84 85 func (c *nodeClient) Save(ctx context.Context, in *point.Point, opts ...grpc.CallOption) (*point.Point, error) { 86 out := new(point.Point) 87 err := c.cc.Invoke(ctx, Node_Save_FullMethodName, in, out, opts...) 88 if err != nil { 89 return nil, err 90 } 91 return out, nil 92 } 93 94 func (c *nodeClient) Remove(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) { 95 out := new(emptypb.Empty) 96 err := c.cc.Invoke(ctx, Node_Remove_FullMethodName, in, out, opts...) 97 if err != nil { 98 return nil, err 99 } 100 return out, nil 101 } 102 103 func (c *nodeClient) Manager(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*node.Manager, error) { 104 out := new(node.Manager) 105 err := c.cc.Invoke(ctx, Node_Manager_FullMethodName, in, out, opts...) 106 if err != nil { 107 return nil, err 108 } 109 return out, nil 110 } 111 112 func (c *nodeClient) Latency(ctx context.Context, in *latency.Requests, opts ...grpc.CallOption) (*latency.Response, error) { 113 out := new(latency.Response) 114 err := c.cc.Invoke(ctx, Node_Latency_FullMethodName, in, out, opts...) 115 if err != nil { 116 return nil, err 117 } 118 return out, nil 119 } 120 121 // NodeServer is the server API for Node service. 122 // All implementations must embed UnimplementedNodeServer 123 // for forward compatibility 124 type NodeServer interface { 125 Now(context.Context, *emptypb.Empty) (*NowResp, error) 126 // use req is hash string of point 127 Use(context.Context, *UseReq) (*point.Point, error) 128 Get(context.Context, *wrapperspb.StringValue) (*point.Point, error) 129 Save(context.Context, *point.Point) (*point.Point, error) 130 Remove(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) 131 Manager(context.Context, *emptypb.Empty) (*node.Manager, error) 132 Latency(context.Context, *latency.Requests) (*latency.Response, error) 133 mustEmbedUnimplementedNodeServer() 134 } 135 136 // UnimplementedNodeServer must be embedded to have forward compatible implementations. 137 type UnimplementedNodeServer struct { 138 } 139 140 func (UnimplementedNodeServer) Now(context.Context, *emptypb.Empty) (*NowResp, error) { 141 return nil, status.Errorf(codes.Unimplemented, "method Now not implemented") 142 } 143 func (UnimplementedNodeServer) Use(context.Context, *UseReq) (*point.Point, error) { 144 return nil, status.Errorf(codes.Unimplemented, "method Use not implemented") 145 } 146 func (UnimplementedNodeServer) Get(context.Context, *wrapperspb.StringValue) (*point.Point, error) { 147 return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") 148 } 149 func (UnimplementedNodeServer) Save(context.Context, *point.Point) (*point.Point, error) { 150 return nil, status.Errorf(codes.Unimplemented, "method Save not implemented") 151 } 152 func (UnimplementedNodeServer) Remove(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) { 153 return nil, status.Errorf(codes.Unimplemented, "method Remove not implemented") 154 } 155 func (UnimplementedNodeServer) Manager(context.Context, *emptypb.Empty) (*node.Manager, error) { 156 return nil, status.Errorf(codes.Unimplemented, "method Manager not implemented") 157 } 158 func (UnimplementedNodeServer) Latency(context.Context, *latency.Requests) (*latency.Response, error) { 159 return nil, status.Errorf(codes.Unimplemented, "method Latency not implemented") 160 } 161 func (UnimplementedNodeServer) mustEmbedUnimplementedNodeServer() {} 162 163 // UnsafeNodeServer may be embedded to opt out of forward compatibility for this service. 164 // Use of this interface is not recommended, as added methods to NodeServer will 165 // result in compilation errors. 166 type UnsafeNodeServer interface { 167 mustEmbedUnimplementedNodeServer() 168 } 169 170 func RegisterNodeServer(s grpc.ServiceRegistrar, srv NodeServer) { 171 s.RegisterService(&Node_ServiceDesc, srv) 172 } 173 174 func _Node_Now_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 175 in := new(emptypb.Empty) 176 if err := dec(in); err != nil { 177 return nil, err 178 } 179 if interceptor == nil { 180 return srv.(NodeServer).Now(ctx, in) 181 } 182 info := &grpc.UnaryServerInfo{ 183 Server: srv, 184 FullMethod: Node_Now_FullMethodName, 185 } 186 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 187 return srv.(NodeServer).Now(ctx, req.(*emptypb.Empty)) 188 } 189 return interceptor(ctx, in, info, handler) 190 } 191 192 func _Node_Use_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 193 in := new(UseReq) 194 if err := dec(in); err != nil { 195 return nil, err 196 } 197 if interceptor == nil { 198 return srv.(NodeServer).Use(ctx, in) 199 } 200 info := &grpc.UnaryServerInfo{ 201 Server: srv, 202 FullMethod: Node_Use_FullMethodName, 203 } 204 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 205 return srv.(NodeServer).Use(ctx, req.(*UseReq)) 206 } 207 return interceptor(ctx, in, info, handler) 208 } 209 210 func _Node_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 211 in := new(wrapperspb.StringValue) 212 if err := dec(in); err != nil { 213 return nil, err 214 } 215 if interceptor == nil { 216 return srv.(NodeServer).Get(ctx, in) 217 } 218 info := &grpc.UnaryServerInfo{ 219 Server: srv, 220 FullMethod: Node_Get_FullMethodName, 221 } 222 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 223 return srv.(NodeServer).Get(ctx, req.(*wrapperspb.StringValue)) 224 } 225 return interceptor(ctx, in, info, handler) 226 } 227 228 func _Node_Save_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 229 in := new(point.Point) 230 if err := dec(in); err != nil { 231 return nil, err 232 } 233 if interceptor == nil { 234 return srv.(NodeServer).Save(ctx, in) 235 } 236 info := &grpc.UnaryServerInfo{ 237 Server: srv, 238 FullMethod: Node_Save_FullMethodName, 239 } 240 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 241 return srv.(NodeServer).Save(ctx, req.(*point.Point)) 242 } 243 return interceptor(ctx, in, info, handler) 244 } 245 246 func _Node_Remove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 247 in := new(wrapperspb.StringValue) 248 if err := dec(in); err != nil { 249 return nil, err 250 } 251 if interceptor == nil { 252 return srv.(NodeServer).Remove(ctx, in) 253 } 254 info := &grpc.UnaryServerInfo{ 255 Server: srv, 256 FullMethod: Node_Remove_FullMethodName, 257 } 258 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 259 return srv.(NodeServer).Remove(ctx, req.(*wrapperspb.StringValue)) 260 } 261 return interceptor(ctx, in, info, handler) 262 } 263 264 func _Node_Manager_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 265 in := new(emptypb.Empty) 266 if err := dec(in); err != nil { 267 return nil, err 268 } 269 if interceptor == nil { 270 return srv.(NodeServer).Manager(ctx, in) 271 } 272 info := &grpc.UnaryServerInfo{ 273 Server: srv, 274 FullMethod: Node_Manager_FullMethodName, 275 } 276 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 277 return srv.(NodeServer).Manager(ctx, req.(*emptypb.Empty)) 278 } 279 return interceptor(ctx, in, info, handler) 280 } 281 282 func _Node_Latency_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 283 in := new(latency.Requests) 284 if err := dec(in); err != nil { 285 return nil, err 286 } 287 if interceptor == nil { 288 return srv.(NodeServer).Latency(ctx, in) 289 } 290 info := &grpc.UnaryServerInfo{ 291 Server: srv, 292 FullMethod: Node_Latency_FullMethodName, 293 } 294 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 295 return srv.(NodeServer).Latency(ctx, req.(*latency.Requests)) 296 } 297 return interceptor(ctx, in, info, handler) 298 } 299 300 // Node_ServiceDesc is the grpc.ServiceDesc for Node service. 301 // It's only intended for direct use with grpc.RegisterService, 302 // and not to be introspected or modified (even as a copy) 303 var Node_ServiceDesc = grpc.ServiceDesc{ 304 ServiceName: "yuhaiin.protos.node.service.node", 305 HandlerType: (*NodeServer)(nil), 306 Methods: []grpc.MethodDesc{ 307 { 308 MethodName: "now", 309 Handler: _Node_Now_Handler, 310 }, 311 { 312 MethodName: "use", 313 Handler: _Node_Use_Handler, 314 }, 315 { 316 MethodName: "get", 317 Handler: _Node_Get_Handler, 318 }, 319 { 320 MethodName: "save", 321 Handler: _Node_Save_Handler, 322 }, 323 { 324 MethodName: "remove", 325 Handler: _Node_Remove_Handler, 326 }, 327 { 328 MethodName: "manager", 329 Handler: _Node_Manager_Handler, 330 }, 331 { 332 MethodName: "latency", 333 Handler: _Node_Latency_Handler, 334 }, 335 }, 336 Streams: []grpc.StreamDesc{}, 337 Metadata: "node/grpc/node.proto", 338 } 339 340 const ( 341 Subscribe_Save_FullMethodName = "/yuhaiin.protos.node.service.subscribe/save" 342 Subscribe_Remove_FullMethodName = "/yuhaiin.protos.node.service.subscribe/remove" 343 Subscribe_Update_FullMethodName = "/yuhaiin.protos.node.service.subscribe/update" 344 Subscribe_Get_FullMethodName = "/yuhaiin.protos.node.service.subscribe/get" 345 ) 346 347 // SubscribeClient is the client API for Subscribe service. 348 // 349 // 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. 350 type SubscribeClient interface { 351 Save(ctx context.Context, in *SaveLinkReq, opts ...grpc.CallOption) (*emptypb.Empty, error) 352 Remove(ctx context.Context, in *LinkReq, opts ...grpc.CallOption) (*emptypb.Empty, error) 353 Update(ctx context.Context, in *LinkReq, opts ...grpc.CallOption) (*emptypb.Empty, error) 354 Get(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetLinksResp, error) 355 } 356 357 type subscribeClient struct { 358 cc grpc.ClientConnInterface 359 } 360 361 func NewSubscribeClient(cc grpc.ClientConnInterface) SubscribeClient { 362 return &subscribeClient{cc} 363 } 364 365 func (c *subscribeClient) Save(ctx context.Context, in *SaveLinkReq, opts ...grpc.CallOption) (*emptypb.Empty, error) { 366 out := new(emptypb.Empty) 367 err := c.cc.Invoke(ctx, Subscribe_Save_FullMethodName, in, out, opts...) 368 if err != nil { 369 return nil, err 370 } 371 return out, nil 372 } 373 374 func (c *subscribeClient) Remove(ctx context.Context, in *LinkReq, opts ...grpc.CallOption) (*emptypb.Empty, error) { 375 out := new(emptypb.Empty) 376 err := c.cc.Invoke(ctx, Subscribe_Remove_FullMethodName, in, out, opts...) 377 if err != nil { 378 return nil, err 379 } 380 return out, nil 381 } 382 383 func (c *subscribeClient) Update(ctx context.Context, in *LinkReq, opts ...grpc.CallOption) (*emptypb.Empty, error) { 384 out := new(emptypb.Empty) 385 err := c.cc.Invoke(ctx, Subscribe_Update_FullMethodName, in, out, opts...) 386 if err != nil { 387 return nil, err 388 } 389 return out, nil 390 } 391 392 func (c *subscribeClient) Get(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetLinksResp, error) { 393 out := new(GetLinksResp) 394 err := c.cc.Invoke(ctx, Subscribe_Get_FullMethodName, in, out, opts...) 395 if err != nil { 396 return nil, err 397 } 398 return out, nil 399 } 400 401 // SubscribeServer is the server API for Subscribe service. 402 // All implementations must embed UnimplementedSubscribeServer 403 // for forward compatibility 404 type SubscribeServer interface { 405 Save(context.Context, *SaveLinkReq) (*emptypb.Empty, error) 406 Remove(context.Context, *LinkReq) (*emptypb.Empty, error) 407 Update(context.Context, *LinkReq) (*emptypb.Empty, error) 408 Get(context.Context, *emptypb.Empty) (*GetLinksResp, error) 409 mustEmbedUnimplementedSubscribeServer() 410 } 411 412 // UnimplementedSubscribeServer must be embedded to have forward compatible implementations. 413 type UnimplementedSubscribeServer struct { 414 } 415 416 func (UnimplementedSubscribeServer) Save(context.Context, *SaveLinkReq) (*emptypb.Empty, error) { 417 return nil, status.Errorf(codes.Unimplemented, "method Save not implemented") 418 } 419 func (UnimplementedSubscribeServer) Remove(context.Context, *LinkReq) (*emptypb.Empty, error) { 420 return nil, status.Errorf(codes.Unimplemented, "method Remove not implemented") 421 } 422 func (UnimplementedSubscribeServer) Update(context.Context, *LinkReq) (*emptypb.Empty, error) { 423 return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") 424 } 425 func (UnimplementedSubscribeServer) Get(context.Context, *emptypb.Empty) (*GetLinksResp, error) { 426 return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") 427 } 428 func (UnimplementedSubscribeServer) mustEmbedUnimplementedSubscribeServer() {} 429 430 // UnsafeSubscribeServer may be embedded to opt out of forward compatibility for this service. 431 // Use of this interface is not recommended, as added methods to SubscribeServer will 432 // result in compilation errors. 433 type UnsafeSubscribeServer interface { 434 mustEmbedUnimplementedSubscribeServer() 435 } 436 437 func RegisterSubscribeServer(s grpc.ServiceRegistrar, srv SubscribeServer) { 438 s.RegisterService(&Subscribe_ServiceDesc, srv) 439 } 440 441 func _Subscribe_Save_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 442 in := new(SaveLinkReq) 443 if err := dec(in); err != nil { 444 return nil, err 445 } 446 if interceptor == nil { 447 return srv.(SubscribeServer).Save(ctx, in) 448 } 449 info := &grpc.UnaryServerInfo{ 450 Server: srv, 451 FullMethod: Subscribe_Save_FullMethodName, 452 } 453 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 454 return srv.(SubscribeServer).Save(ctx, req.(*SaveLinkReq)) 455 } 456 return interceptor(ctx, in, info, handler) 457 } 458 459 func _Subscribe_Remove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 460 in := new(LinkReq) 461 if err := dec(in); err != nil { 462 return nil, err 463 } 464 if interceptor == nil { 465 return srv.(SubscribeServer).Remove(ctx, in) 466 } 467 info := &grpc.UnaryServerInfo{ 468 Server: srv, 469 FullMethod: Subscribe_Remove_FullMethodName, 470 } 471 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 472 return srv.(SubscribeServer).Remove(ctx, req.(*LinkReq)) 473 } 474 return interceptor(ctx, in, info, handler) 475 } 476 477 func _Subscribe_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 478 in := new(LinkReq) 479 if err := dec(in); err != nil { 480 return nil, err 481 } 482 if interceptor == nil { 483 return srv.(SubscribeServer).Update(ctx, in) 484 } 485 info := &grpc.UnaryServerInfo{ 486 Server: srv, 487 FullMethod: Subscribe_Update_FullMethodName, 488 } 489 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 490 return srv.(SubscribeServer).Update(ctx, req.(*LinkReq)) 491 } 492 return interceptor(ctx, in, info, handler) 493 } 494 495 func _Subscribe_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 496 in := new(emptypb.Empty) 497 if err := dec(in); err != nil { 498 return nil, err 499 } 500 if interceptor == nil { 501 return srv.(SubscribeServer).Get(ctx, in) 502 } 503 info := &grpc.UnaryServerInfo{ 504 Server: srv, 505 FullMethod: Subscribe_Get_FullMethodName, 506 } 507 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 508 return srv.(SubscribeServer).Get(ctx, req.(*emptypb.Empty)) 509 } 510 return interceptor(ctx, in, info, handler) 511 } 512 513 // Subscribe_ServiceDesc is the grpc.ServiceDesc for Subscribe service. 514 // It's only intended for direct use with grpc.RegisterService, 515 // and not to be introspected or modified (even as a copy) 516 var Subscribe_ServiceDesc = grpc.ServiceDesc{ 517 ServiceName: "yuhaiin.protos.node.service.subscribe", 518 HandlerType: (*SubscribeServer)(nil), 519 Methods: []grpc.MethodDesc{ 520 { 521 MethodName: "save", 522 Handler: _Subscribe_Save_Handler, 523 }, 524 { 525 MethodName: "remove", 526 Handler: _Subscribe_Remove_Handler, 527 }, 528 { 529 MethodName: "update", 530 Handler: _Subscribe_Update_Handler, 531 }, 532 { 533 MethodName: "get", 534 Handler: _Subscribe_Get_Handler, 535 }, 536 }, 537 Streams: []grpc.StreamDesc{}, 538 Metadata: "node/grpc/node.proto", 539 } 540 541 const ( 542 Tag_Save_FullMethodName = "/yuhaiin.protos.node.service.tag/save" 543 Tag_Remove_FullMethodName = "/yuhaiin.protos.node.service.tag/remove" 544 ) 545 546 // TagClient is the client API for Tag service. 547 // 548 // 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. 549 type TagClient interface { 550 Save(ctx context.Context, in *SaveTagReq, opts ...grpc.CallOption) (*emptypb.Empty, error) 551 Remove(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) 552 } 553 554 type tagClient struct { 555 cc grpc.ClientConnInterface 556 } 557 558 func NewTagClient(cc grpc.ClientConnInterface) TagClient { 559 return &tagClient{cc} 560 } 561 562 func (c *tagClient) Save(ctx context.Context, in *SaveTagReq, opts ...grpc.CallOption) (*emptypb.Empty, error) { 563 out := new(emptypb.Empty) 564 err := c.cc.Invoke(ctx, Tag_Save_FullMethodName, in, out, opts...) 565 if err != nil { 566 return nil, err 567 } 568 return out, nil 569 } 570 571 func (c *tagClient) Remove(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) { 572 out := new(emptypb.Empty) 573 err := c.cc.Invoke(ctx, Tag_Remove_FullMethodName, in, out, opts...) 574 if err != nil { 575 return nil, err 576 } 577 return out, nil 578 } 579 580 // TagServer is the server API for Tag service. 581 // All implementations must embed UnimplementedTagServer 582 // for forward compatibility 583 type TagServer interface { 584 Save(context.Context, *SaveTagReq) (*emptypb.Empty, error) 585 Remove(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) 586 mustEmbedUnimplementedTagServer() 587 } 588 589 // UnimplementedTagServer must be embedded to have forward compatible implementations. 590 type UnimplementedTagServer struct { 591 } 592 593 func (UnimplementedTagServer) Save(context.Context, *SaveTagReq) (*emptypb.Empty, error) { 594 return nil, status.Errorf(codes.Unimplemented, "method Save not implemented") 595 } 596 func (UnimplementedTagServer) Remove(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) { 597 return nil, status.Errorf(codes.Unimplemented, "method Remove not implemented") 598 } 599 func (UnimplementedTagServer) mustEmbedUnimplementedTagServer() {} 600 601 // UnsafeTagServer may be embedded to opt out of forward compatibility for this service. 602 // Use of this interface is not recommended, as added methods to TagServer will 603 // result in compilation errors. 604 type UnsafeTagServer interface { 605 mustEmbedUnimplementedTagServer() 606 } 607 608 func RegisterTagServer(s grpc.ServiceRegistrar, srv TagServer) { 609 s.RegisterService(&Tag_ServiceDesc, srv) 610 } 611 612 func _Tag_Save_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 613 in := new(SaveTagReq) 614 if err := dec(in); err != nil { 615 return nil, err 616 } 617 if interceptor == nil { 618 return srv.(TagServer).Save(ctx, in) 619 } 620 info := &grpc.UnaryServerInfo{ 621 Server: srv, 622 FullMethod: Tag_Save_FullMethodName, 623 } 624 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 625 return srv.(TagServer).Save(ctx, req.(*SaveTagReq)) 626 } 627 return interceptor(ctx, in, info, handler) 628 } 629 630 func _Tag_Remove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 631 in := new(wrapperspb.StringValue) 632 if err := dec(in); err != nil { 633 return nil, err 634 } 635 if interceptor == nil { 636 return srv.(TagServer).Remove(ctx, in) 637 } 638 info := &grpc.UnaryServerInfo{ 639 Server: srv, 640 FullMethod: Tag_Remove_FullMethodName, 641 } 642 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 643 return srv.(TagServer).Remove(ctx, req.(*wrapperspb.StringValue)) 644 } 645 return interceptor(ctx, in, info, handler) 646 } 647 648 // Tag_ServiceDesc is the grpc.ServiceDesc for Tag service. 649 // It's only intended for direct use with grpc.RegisterService, 650 // and not to be introspected or modified (even as a copy) 651 var Tag_ServiceDesc = grpc.ServiceDesc{ 652 ServiceName: "yuhaiin.protos.node.service.tag", 653 HandlerType: (*TagServer)(nil), 654 Methods: []grpc.MethodDesc{ 655 { 656 MethodName: "save", 657 Handler: _Tag_Save_Handler, 658 }, 659 { 660 MethodName: "remove", 661 Handler: _Tag_Remove_Handler, 662 }, 663 }, 664 Streams: []grpc.StreamDesc{}, 665 Metadata: "node/grpc/node.proto", 666 }