mq_grpc.pb.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.2.0
  4. // - protoc v3.21.12
  5. // source: mq.proto
  6. package mq_pb
  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.32.0 or later.
  16. const _ = grpc.SupportPackageIsVersion7
  17. // SeaweedMessagingClient is the client API for SeaweedMessaging service.
  18. //
  19. // 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.
  20. type SeaweedMessagingClient interface {
  21. // control plane
  22. FindBrokerLeader(ctx context.Context, in *FindBrokerLeaderRequest, opts ...grpc.CallOption) (*FindBrokerLeaderResponse, error)
  23. AssignSegmentBrokers(ctx context.Context, in *AssignSegmentBrokersRequest, opts ...grpc.CallOption) (*AssignSegmentBrokersResponse, error)
  24. CheckSegmentStatus(ctx context.Context, in *CheckSegmentStatusRequest, opts ...grpc.CallOption) (*CheckSegmentStatusResponse, error)
  25. CheckBrokerLoad(ctx context.Context, in *CheckBrokerLoadRequest, opts ...grpc.CallOption) (*CheckBrokerLoadResponse, error)
  26. // data plane
  27. Publish(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_PublishClient, error)
  28. }
  29. type seaweedMessagingClient struct {
  30. cc grpc.ClientConnInterface
  31. }
  32. func NewSeaweedMessagingClient(cc grpc.ClientConnInterface) SeaweedMessagingClient {
  33. return &seaweedMessagingClient{cc}
  34. }
  35. func (c *seaweedMessagingClient) FindBrokerLeader(ctx context.Context, in *FindBrokerLeaderRequest, opts ...grpc.CallOption) (*FindBrokerLeaderResponse, error) {
  36. out := new(FindBrokerLeaderResponse)
  37. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/FindBrokerLeader", in, out, opts...)
  38. if err != nil {
  39. return nil, err
  40. }
  41. return out, nil
  42. }
  43. func (c *seaweedMessagingClient) AssignSegmentBrokers(ctx context.Context, in *AssignSegmentBrokersRequest, opts ...grpc.CallOption) (*AssignSegmentBrokersResponse, error) {
  44. out := new(AssignSegmentBrokersResponse)
  45. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/AssignSegmentBrokers", in, out, opts...)
  46. if err != nil {
  47. return nil, err
  48. }
  49. return out, nil
  50. }
  51. func (c *seaweedMessagingClient) CheckSegmentStatus(ctx context.Context, in *CheckSegmentStatusRequest, opts ...grpc.CallOption) (*CheckSegmentStatusResponse, error) {
  52. out := new(CheckSegmentStatusResponse)
  53. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/CheckSegmentStatus", in, out, opts...)
  54. if err != nil {
  55. return nil, err
  56. }
  57. return out, nil
  58. }
  59. func (c *seaweedMessagingClient) CheckBrokerLoad(ctx context.Context, in *CheckBrokerLoadRequest, opts ...grpc.CallOption) (*CheckBrokerLoadResponse, error) {
  60. out := new(CheckBrokerLoadResponse)
  61. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/CheckBrokerLoad", in, out, opts...)
  62. if err != nil {
  63. return nil, err
  64. }
  65. return out, nil
  66. }
  67. func (c *seaweedMessagingClient) Publish(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_PublishClient, error) {
  68. stream, err := c.cc.NewStream(ctx, &SeaweedMessaging_ServiceDesc.Streams[0], "/messaging_pb.SeaweedMessaging/Publish", opts...)
  69. if err != nil {
  70. return nil, err
  71. }
  72. x := &seaweedMessagingPublishClient{stream}
  73. return x, nil
  74. }
  75. type SeaweedMessaging_PublishClient interface {
  76. Send(*PublishRequest) error
  77. Recv() (*PublishResponse, error)
  78. grpc.ClientStream
  79. }
  80. type seaweedMessagingPublishClient struct {
  81. grpc.ClientStream
  82. }
  83. func (x *seaweedMessagingPublishClient) Send(m *PublishRequest) error {
  84. return x.ClientStream.SendMsg(m)
  85. }
  86. func (x *seaweedMessagingPublishClient) Recv() (*PublishResponse, error) {
  87. m := new(PublishResponse)
  88. if err := x.ClientStream.RecvMsg(m); err != nil {
  89. return nil, err
  90. }
  91. return m, nil
  92. }
  93. // SeaweedMessagingServer is the server API for SeaweedMessaging service.
  94. // All implementations must embed UnimplementedSeaweedMessagingServer
  95. // for forward compatibility
  96. type SeaweedMessagingServer interface {
  97. // control plane
  98. FindBrokerLeader(context.Context, *FindBrokerLeaderRequest) (*FindBrokerLeaderResponse, error)
  99. AssignSegmentBrokers(context.Context, *AssignSegmentBrokersRequest) (*AssignSegmentBrokersResponse, error)
  100. CheckSegmentStatus(context.Context, *CheckSegmentStatusRequest) (*CheckSegmentStatusResponse, error)
  101. CheckBrokerLoad(context.Context, *CheckBrokerLoadRequest) (*CheckBrokerLoadResponse, error)
  102. // data plane
  103. Publish(SeaweedMessaging_PublishServer) error
  104. mustEmbedUnimplementedSeaweedMessagingServer()
  105. }
  106. // UnimplementedSeaweedMessagingServer must be embedded to have forward compatible implementations.
  107. type UnimplementedSeaweedMessagingServer struct {
  108. }
  109. func (UnimplementedSeaweedMessagingServer) FindBrokerLeader(context.Context, *FindBrokerLeaderRequest) (*FindBrokerLeaderResponse, error) {
  110. return nil, status.Errorf(codes.Unimplemented, "method FindBrokerLeader not implemented")
  111. }
  112. func (UnimplementedSeaweedMessagingServer) AssignSegmentBrokers(context.Context, *AssignSegmentBrokersRequest) (*AssignSegmentBrokersResponse, error) {
  113. return nil, status.Errorf(codes.Unimplemented, "method AssignSegmentBrokers not implemented")
  114. }
  115. func (UnimplementedSeaweedMessagingServer) CheckSegmentStatus(context.Context, *CheckSegmentStatusRequest) (*CheckSegmentStatusResponse, error) {
  116. return nil, status.Errorf(codes.Unimplemented, "method CheckSegmentStatus not implemented")
  117. }
  118. func (UnimplementedSeaweedMessagingServer) CheckBrokerLoad(context.Context, *CheckBrokerLoadRequest) (*CheckBrokerLoadResponse, error) {
  119. return nil, status.Errorf(codes.Unimplemented, "method CheckBrokerLoad not implemented")
  120. }
  121. func (UnimplementedSeaweedMessagingServer) Publish(SeaweedMessaging_PublishServer) error {
  122. return status.Errorf(codes.Unimplemented, "method Publish not implemented")
  123. }
  124. func (UnimplementedSeaweedMessagingServer) mustEmbedUnimplementedSeaweedMessagingServer() {}
  125. // UnsafeSeaweedMessagingServer may be embedded to opt out of forward compatibility for this service.
  126. // Use of this interface is not recommended, as added methods to SeaweedMessagingServer will
  127. // result in compilation errors.
  128. type UnsafeSeaweedMessagingServer interface {
  129. mustEmbedUnimplementedSeaweedMessagingServer()
  130. }
  131. func RegisterSeaweedMessagingServer(s grpc.ServiceRegistrar, srv SeaweedMessagingServer) {
  132. s.RegisterService(&SeaweedMessaging_ServiceDesc, srv)
  133. }
  134. func _SeaweedMessaging_FindBrokerLeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  135. in := new(FindBrokerLeaderRequest)
  136. if err := dec(in); err != nil {
  137. return nil, err
  138. }
  139. if interceptor == nil {
  140. return srv.(SeaweedMessagingServer).FindBrokerLeader(ctx, in)
  141. }
  142. info := &grpc.UnaryServerInfo{
  143. Server: srv,
  144. FullMethod: "/messaging_pb.SeaweedMessaging/FindBrokerLeader",
  145. }
  146. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  147. return srv.(SeaweedMessagingServer).FindBrokerLeader(ctx, req.(*FindBrokerLeaderRequest))
  148. }
  149. return interceptor(ctx, in, info, handler)
  150. }
  151. func _SeaweedMessaging_AssignSegmentBrokers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  152. in := new(AssignSegmentBrokersRequest)
  153. if err := dec(in); err != nil {
  154. return nil, err
  155. }
  156. if interceptor == nil {
  157. return srv.(SeaweedMessagingServer).AssignSegmentBrokers(ctx, in)
  158. }
  159. info := &grpc.UnaryServerInfo{
  160. Server: srv,
  161. FullMethod: "/messaging_pb.SeaweedMessaging/AssignSegmentBrokers",
  162. }
  163. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  164. return srv.(SeaweedMessagingServer).AssignSegmentBrokers(ctx, req.(*AssignSegmentBrokersRequest))
  165. }
  166. return interceptor(ctx, in, info, handler)
  167. }
  168. func _SeaweedMessaging_CheckSegmentStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  169. in := new(CheckSegmentStatusRequest)
  170. if err := dec(in); err != nil {
  171. return nil, err
  172. }
  173. if interceptor == nil {
  174. return srv.(SeaweedMessagingServer).CheckSegmentStatus(ctx, in)
  175. }
  176. info := &grpc.UnaryServerInfo{
  177. Server: srv,
  178. FullMethod: "/messaging_pb.SeaweedMessaging/CheckSegmentStatus",
  179. }
  180. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  181. return srv.(SeaweedMessagingServer).CheckSegmentStatus(ctx, req.(*CheckSegmentStatusRequest))
  182. }
  183. return interceptor(ctx, in, info, handler)
  184. }
  185. func _SeaweedMessaging_CheckBrokerLoad_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  186. in := new(CheckBrokerLoadRequest)
  187. if err := dec(in); err != nil {
  188. return nil, err
  189. }
  190. if interceptor == nil {
  191. return srv.(SeaweedMessagingServer).CheckBrokerLoad(ctx, in)
  192. }
  193. info := &grpc.UnaryServerInfo{
  194. Server: srv,
  195. FullMethod: "/messaging_pb.SeaweedMessaging/CheckBrokerLoad",
  196. }
  197. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  198. return srv.(SeaweedMessagingServer).CheckBrokerLoad(ctx, req.(*CheckBrokerLoadRequest))
  199. }
  200. return interceptor(ctx, in, info, handler)
  201. }
  202. func _SeaweedMessaging_Publish_Handler(srv interface{}, stream grpc.ServerStream) error {
  203. return srv.(SeaweedMessagingServer).Publish(&seaweedMessagingPublishServer{stream})
  204. }
  205. type SeaweedMessaging_PublishServer interface {
  206. Send(*PublishResponse) error
  207. Recv() (*PublishRequest, error)
  208. grpc.ServerStream
  209. }
  210. type seaweedMessagingPublishServer struct {
  211. grpc.ServerStream
  212. }
  213. func (x *seaweedMessagingPublishServer) Send(m *PublishResponse) error {
  214. return x.ServerStream.SendMsg(m)
  215. }
  216. func (x *seaweedMessagingPublishServer) Recv() (*PublishRequest, error) {
  217. m := new(PublishRequest)
  218. if err := x.ServerStream.RecvMsg(m); err != nil {
  219. return nil, err
  220. }
  221. return m, nil
  222. }
  223. // SeaweedMessaging_ServiceDesc is the grpc.ServiceDesc for SeaweedMessaging service.
  224. // It's only intended for direct use with grpc.RegisterService,
  225. // and not to be introspected or modified (even as a copy)
  226. var SeaweedMessaging_ServiceDesc = grpc.ServiceDesc{
  227. ServiceName: "messaging_pb.SeaweedMessaging",
  228. HandlerType: (*SeaweedMessagingServer)(nil),
  229. Methods: []grpc.MethodDesc{
  230. {
  231. MethodName: "FindBrokerLeader",
  232. Handler: _SeaweedMessaging_FindBrokerLeader_Handler,
  233. },
  234. {
  235. MethodName: "AssignSegmentBrokers",
  236. Handler: _SeaweedMessaging_AssignSegmentBrokers_Handler,
  237. },
  238. {
  239. MethodName: "CheckSegmentStatus",
  240. Handler: _SeaweedMessaging_CheckSegmentStatus_Handler,
  241. },
  242. {
  243. MethodName: "CheckBrokerLoad",
  244. Handler: _SeaweedMessaging_CheckBrokerLoad_Handler,
  245. },
  246. },
  247. Streams: []grpc.StreamDesc{
  248. {
  249. StreamName: "Publish",
  250. Handler: _SeaweedMessaging_Publish_Handler,
  251. ServerStreams: true,
  252. ClientStreams: true,
  253. },
  254. },
  255. Metadata: "mq.proto",
  256. }