statistics_grpc.pb.go 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. package statistics
  3. import (
  4. context "context"
  5. grpc "google.golang.org/grpc"
  6. codes "google.golang.org/grpc/codes"
  7. status "google.golang.org/grpc/status"
  8. emptypb "google.golang.org/protobuf/types/known/emptypb"
  9. )
  10. // This is a compile-time assertion to ensure that this generated file
  11. // is compatible with the grpc package it is being compiled against.
  12. // Requires gRPC-Go v1.32.0 or later.
  13. const _ = grpc.SupportPackageIsVersion7
  14. // StatisticsClient is the client API for Statistics service.
  15. //
  16. // 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.
  17. type StatisticsClient interface {
  18. LookPerson(ctx context.Context, in *PersonMessage, opts ...grpc.CallOption) (*emptypb.Empty, error)
  19. LikePerson(ctx context.Context, in *PersonMessage, opts ...grpc.CallOption) (*emptypb.Empty, error)
  20. UnLikePerson(ctx context.Context, in *PersonMessage, opts ...grpc.CallOption) (*emptypb.Empty, error)
  21. }
  22. type statisticsClient struct {
  23. cc grpc.ClientConnInterface
  24. }
  25. func NewStatisticsClient(cc grpc.ClientConnInterface) StatisticsClient {
  26. return &statisticsClient{cc}
  27. }
  28. func (c *statisticsClient) LookPerson(ctx context.Context, in *PersonMessage, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  29. out := new(emptypb.Empty)
  30. err := c.cc.Invoke(ctx, "/api.statistics.Statistics/LookPerson", in, out, opts...)
  31. if err != nil {
  32. return nil, err
  33. }
  34. return out, nil
  35. }
  36. func (c *statisticsClient) LikePerson(ctx context.Context, in *PersonMessage, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  37. out := new(emptypb.Empty)
  38. err := c.cc.Invoke(ctx, "/api.statistics.Statistics/LikePerson", in, out, opts...)
  39. if err != nil {
  40. return nil, err
  41. }
  42. return out, nil
  43. }
  44. func (c *statisticsClient) UnLikePerson(ctx context.Context, in *PersonMessage, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  45. out := new(emptypb.Empty)
  46. err := c.cc.Invoke(ctx, "/api.statistics.Statistics/UnLikePerson", in, out, opts...)
  47. if err != nil {
  48. return nil, err
  49. }
  50. return out, nil
  51. }
  52. // StatisticsServer is the server API for Statistics service.
  53. // All implementations must embed UnimplementedStatisticsServer
  54. // for forward compatibility
  55. type StatisticsServer interface {
  56. LookPerson(context.Context, *PersonMessage) (*emptypb.Empty, error)
  57. LikePerson(context.Context, *PersonMessage) (*emptypb.Empty, error)
  58. UnLikePerson(context.Context, *PersonMessage) (*emptypb.Empty, error)
  59. mustEmbedUnimplementedStatisticsServer()
  60. }
  61. // UnimplementedStatisticsServer must be embedded to have forward compatible implementations.
  62. type UnimplementedStatisticsServer struct {
  63. }
  64. func (UnimplementedStatisticsServer) LookPerson(context.Context, *PersonMessage) (*emptypb.Empty, error) {
  65. return nil, status.Errorf(codes.Unimplemented, "method LookPerson not implemented")
  66. }
  67. func (UnimplementedStatisticsServer) LikePerson(context.Context, *PersonMessage) (*emptypb.Empty, error) {
  68. return nil, status.Errorf(codes.Unimplemented, "method LikePerson not implemented")
  69. }
  70. func (UnimplementedStatisticsServer) UnLikePerson(context.Context, *PersonMessage) (*emptypb.Empty, error) {
  71. return nil, status.Errorf(codes.Unimplemented, "method UnLikePerson not implemented")
  72. }
  73. func (UnimplementedStatisticsServer) mustEmbedUnimplementedStatisticsServer() {}
  74. // UnsafeStatisticsServer may be embedded to opt out of forward compatibility for this service.
  75. // Use of this interface is not recommended, as added methods to StatisticsServer will
  76. // result in compilation errors.
  77. type UnsafeStatisticsServer interface {
  78. mustEmbedUnimplementedStatisticsServer()
  79. }
  80. func RegisterStatisticsServer(s grpc.ServiceRegistrar, srv StatisticsServer) {
  81. s.RegisterService(&Statistics_ServiceDesc, srv)
  82. }
  83. func _Statistics_LookPerson_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  84. in := new(PersonMessage)
  85. if err := dec(in); err != nil {
  86. return nil, err
  87. }
  88. if interceptor == nil {
  89. return srv.(StatisticsServer).LookPerson(ctx, in)
  90. }
  91. info := &grpc.UnaryServerInfo{
  92. Server: srv,
  93. FullMethod: "/api.statistics.Statistics/LookPerson",
  94. }
  95. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  96. return srv.(StatisticsServer).LookPerson(ctx, req.(*PersonMessage))
  97. }
  98. return interceptor(ctx, in, info, handler)
  99. }
  100. func _Statistics_LikePerson_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  101. in := new(PersonMessage)
  102. if err := dec(in); err != nil {
  103. return nil, err
  104. }
  105. if interceptor == nil {
  106. return srv.(StatisticsServer).LikePerson(ctx, in)
  107. }
  108. info := &grpc.UnaryServerInfo{
  109. Server: srv,
  110. FullMethod: "/api.statistics.Statistics/LikePerson",
  111. }
  112. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  113. return srv.(StatisticsServer).LikePerson(ctx, req.(*PersonMessage))
  114. }
  115. return interceptor(ctx, in, info, handler)
  116. }
  117. func _Statistics_UnLikePerson_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  118. in := new(PersonMessage)
  119. if err := dec(in); err != nil {
  120. return nil, err
  121. }
  122. if interceptor == nil {
  123. return srv.(StatisticsServer).UnLikePerson(ctx, in)
  124. }
  125. info := &grpc.UnaryServerInfo{
  126. Server: srv,
  127. FullMethod: "/api.statistics.Statistics/UnLikePerson",
  128. }
  129. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  130. return srv.(StatisticsServer).UnLikePerson(ctx, req.(*PersonMessage))
  131. }
  132. return interceptor(ctx, in, info, handler)
  133. }
  134. // Statistics_ServiceDesc is the grpc.ServiceDesc for Statistics service.
  135. // It's only intended for direct use with grpc.RegisterService,
  136. // and not to be introspected or modified (even as a copy)
  137. var Statistics_ServiceDesc = grpc.ServiceDesc{
  138. ServiceName: "api.statistics.Statistics",
  139. HandlerType: (*StatisticsServer)(nil),
  140. Methods: []grpc.MethodDesc{
  141. {
  142. MethodName: "LookPerson",
  143. Handler: _Statistics_LookPerson_Handler,
  144. },
  145. {
  146. MethodName: "LikePerson",
  147. Handler: _Statistics_LikePerson_Handler,
  148. },
  149. {
  150. MethodName: "UnLikePerson",
  151. Handler: _Statistics_UnLikePerson_Handler,
  152. },
  153. },
  154. Streams: []grpc.StreamDesc{},
  155. Metadata: "statistics.proto",
  156. }