client_grpc.pb.go 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.4.0
  4. // - protoc v5.26.1
  5. // source: client.proto
  6. package service
  7. import (
  8. context "context"
  9. grpc "google.golang.org/grpc"
  10. codes "google.golang.org/grpc/codes"
  11. status "google.golang.org/grpc/status"
  12. )
  13. // This is a compile-time assertion to ensure that this generated file
  14. // is compatible with the grpc package it is being compiled against.
  15. // Requires gRPC-Go v1.62.0 or later.
  16. const _ = grpc.SupportPackageIsVersion8
  17. const (
  18. SendMessage_Distribution_FullMethodName = "/SendMessage/Distribution"
  19. )
  20. // SendMessageClient is the client API for SendMessage service.
  21. //
  22. // 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.
  23. //
  24. // 定义rpc服务
  25. type SendMessageClient interface {
  26. // 定义函数
  27. Distribution(ctx context.Context, in *DistributionRequest, opts ...grpc.CallOption) (*DistributionResponse, error)
  28. }
  29. type sendMessageClient struct {
  30. cc grpc.ClientConnInterface
  31. }
  32. func NewSendMessageClient(cc grpc.ClientConnInterface) SendMessageClient {
  33. return &sendMessageClient{cc}
  34. }
  35. func (c *sendMessageClient) Distribution(ctx context.Context, in *DistributionRequest, opts ...grpc.CallOption) (*DistributionResponse, error) {
  36. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  37. out := new(DistributionResponse)
  38. err := c.cc.Invoke(ctx, SendMessage_Distribution_FullMethodName, in, out, cOpts...)
  39. if err != nil {
  40. return nil, err
  41. }
  42. return out, nil
  43. }
  44. // SendMessageServer is the server API for SendMessage service.
  45. // All implementations must embed UnimplementedSendMessageServer
  46. // for forward compatibility
  47. //
  48. // 定义rpc服务
  49. type SendMessageServer interface {
  50. // 定义函数
  51. Distribution(context.Context, *DistributionRequest) (*DistributionResponse, error)
  52. mustEmbedUnimplementedSendMessageServer()
  53. }
  54. // UnimplementedSendMessageServer must be embedded to have forward compatible implementations.
  55. type UnimplementedSendMessageServer struct {
  56. }
  57. func (UnimplementedSendMessageServer) Distribution(context.Context, *DistributionRequest) (*DistributionResponse, error) {
  58. return nil, status.Errorf(codes.Unimplemented, "method Distribution not implemented")
  59. }
  60. func (UnimplementedSendMessageServer) mustEmbedUnimplementedSendMessageServer() {}
  61. // UnsafeSendMessageServer may be embedded to opt out of forward compatibility for this service.
  62. // Use of this interface is not recommended, as added methods to SendMessageServer will
  63. // result in compilation errors.
  64. type UnsafeSendMessageServer interface {
  65. mustEmbedUnimplementedSendMessageServer()
  66. }
  67. func RegisterSendMessageServer(s grpc.ServiceRegistrar, srv SendMessageServer) {
  68. s.RegisterService(&SendMessage_ServiceDesc, srv)
  69. }
  70. func _SendMessage_Distribution_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  71. in := new(DistributionRequest)
  72. if err := dec(in); err != nil {
  73. return nil, err
  74. }
  75. if interceptor == nil {
  76. return srv.(SendMessageServer).Distribution(ctx, in)
  77. }
  78. info := &grpc.UnaryServerInfo{
  79. Server: srv,
  80. FullMethod: SendMessage_Distribution_FullMethodName,
  81. }
  82. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  83. return srv.(SendMessageServer).Distribution(ctx, req.(*DistributionRequest))
  84. }
  85. return interceptor(ctx, in, info, handler)
  86. }
  87. // SendMessage_ServiceDesc is the grpc.ServiceDesc for SendMessage service.
  88. // It's only intended for direct use with grpc.RegisterService,
  89. // and not to be introspected or modified (even as a copy)
  90. var SendMessage_ServiceDesc = grpc.ServiceDesc{
  91. ServiceName: "SendMessage",
  92. HandlerType: (*SendMessageServer)(nil),
  93. Methods: []grpc.MethodDesc{
  94. {
  95. MethodName: "Distribution",
  96. Handler: _SendMessage_Distribution_Handler,
  97. },
  98. },
  99. Streams: []grpc.StreamDesc{},
  100. Metadata: "client.proto",
  101. }