You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

567 lines
22 KiB

3 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
3 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
3 years ago
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.2.0
  4. // - protoc v4.23.3
  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. // control plane for balancer
  27. ConnectToBalancer(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_ConnectToBalancerClient, error)
  28. // control plane for topic partitions
  29. LookupTopicBrokers(ctx context.Context, in *LookupTopicBrokersRequest, opts ...grpc.CallOption) (*LookupTopicBrokersResponse, error)
  30. // a pub client will call this to get the topic partitions assignment
  31. RequestTopicPartitions(ctx context.Context, in *RequestTopicPartitionsRequest, opts ...grpc.CallOption) (*RequestTopicPartitionsResponse, error)
  32. AssignTopicPartitions(ctx context.Context, in *AssignTopicPartitionsRequest, opts ...grpc.CallOption) (*AssignTopicPartitionsResponse, error)
  33. CheckTopicPartitionsStatus(ctx context.Context, in *CheckTopicPartitionsStatusRequest, opts ...grpc.CallOption) (*CheckTopicPartitionsStatusResponse, error)
  34. // data plane
  35. Publish(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_PublishClient, error)
  36. Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (SeaweedMessaging_SubscribeClient, error)
  37. }
  38. type seaweedMessagingClient struct {
  39. cc grpc.ClientConnInterface
  40. }
  41. func NewSeaweedMessagingClient(cc grpc.ClientConnInterface) SeaweedMessagingClient {
  42. return &seaweedMessagingClient{cc}
  43. }
  44. func (c *seaweedMessagingClient) FindBrokerLeader(ctx context.Context, in *FindBrokerLeaderRequest, opts ...grpc.CallOption) (*FindBrokerLeaderResponse, error) {
  45. out := new(FindBrokerLeaderResponse)
  46. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/FindBrokerLeader", in, out, opts...)
  47. if err != nil {
  48. return nil, err
  49. }
  50. return out, nil
  51. }
  52. func (c *seaweedMessagingClient) AssignSegmentBrokers(ctx context.Context, in *AssignSegmentBrokersRequest, opts ...grpc.CallOption) (*AssignSegmentBrokersResponse, error) {
  53. out := new(AssignSegmentBrokersResponse)
  54. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/AssignSegmentBrokers", in, out, opts...)
  55. if err != nil {
  56. return nil, err
  57. }
  58. return out, nil
  59. }
  60. func (c *seaweedMessagingClient) CheckSegmentStatus(ctx context.Context, in *CheckSegmentStatusRequest, opts ...grpc.CallOption) (*CheckSegmentStatusResponse, error) {
  61. out := new(CheckSegmentStatusResponse)
  62. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/CheckSegmentStatus", in, out, opts...)
  63. if err != nil {
  64. return nil, err
  65. }
  66. return out, nil
  67. }
  68. func (c *seaweedMessagingClient) CheckBrokerLoad(ctx context.Context, in *CheckBrokerLoadRequest, opts ...grpc.CallOption) (*CheckBrokerLoadResponse, error) {
  69. out := new(CheckBrokerLoadResponse)
  70. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/CheckBrokerLoad", in, out, opts...)
  71. if err != nil {
  72. return nil, err
  73. }
  74. return out, nil
  75. }
  76. func (c *seaweedMessagingClient) ConnectToBalancer(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_ConnectToBalancerClient, error) {
  77. stream, err := c.cc.NewStream(ctx, &SeaweedMessaging_ServiceDesc.Streams[0], "/messaging_pb.SeaweedMessaging/ConnectToBalancer", opts...)
  78. if err != nil {
  79. return nil, err
  80. }
  81. x := &seaweedMessagingConnectToBalancerClient{stream}
  82. return x, nil
  83. }
  84. type SeaweedMessaging_ConnectToBalancerClient interface {
  85. Send(*ConnectToBalancerRequest) error
  86. Recv() (*ConnectToBalancerResponse, error)
  87. grpc.ClientStream
  88. }
  89. type seaweedMessagingConnectToBalancerClient struct {
  90. grpc.ClientStream
  91. }
  92. func (x *seaweedMessagingConnectToBalancerClient) Send(m *ConnectToBalancerRequest) error {
  93. return x.ClientStream.SendMsg(m)
  94. }
  95. func (x *seaweedMessagingConnectToBalancerClient) Recv() (*ConnectToBalancerResponse, error) {
  96. m := new(ConnectToBalancerResponse)
  97. if err := x.ClientStream.RecvMsg(m); err != nil {
  98. return nil, err
  99. }
  100. return m, nil
  101. }
  102. func (c *seaweedMessagingClient) LookupTopicBrokers(ctx context.Context, in *LookupTopicBrokersRequest, opts ...grpc.CallOption) (*LookupTopicBrokersResponse, error) {
  103. out := new(LookupTopicBrokersResponse)
  104. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/LookupTopicBrokers", in, out, opts...)
  105. if err != nil {
  106. return nil, err
  107. }
  108. return out, nil
  109. }
  110. func (c *seaweedMessagingClient) RequestTopicPartitions(ctx context.Context, in *RequestTopicPartitionsRequest, opts ...grpc.CallOption) (*RequestTopicPartitionsResponse, error) {
  111. out := new(RequestTopicPartitionsResponse)
  112. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/RequestTopicPartitions", in, out, opts...)
  113. if err != nil {
  114. return nil, err
  115. }
  116. return out, nil
  117. }
  118. func (c *seaweedMessagingClient) AssignTopicPartitions(ctx context.Context, in *AssignTopicPartitionsRequest, opts ...grpc.CallOption) (*AssignTopicPartitionsResponse, error) {
  119. out := new(AssignTopicPartitionsResponse)
  120. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/AssignTopicPartitions", in, out, opts...)
  121. if err != nil {
  122. return nil, err
  123. }
  124. return out, nil
  125. }
  126. func (c *seaweedMessagingClient) CheckTopicPartitionsStatus(ctx context.Context, in *CheckTopicPartitionsStatusRequest, opts ...grpc.CallOption) (*CheckTopicPartitionsStatusResponse, error) {
  127. out := new(CheckTopicPartitionsStatusResponse)
  128. err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/CheckTopicPartitionsStatus", in, out, opts...)
  129. if err != nil {
  130. return nil, err
  131. }
  132. return out, nil
  133. }
  134. func (c *seaweedMessagingClient) Publish(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_PublishClient, error) {
  135. stream, err := c.cc.NewStream(ctx, &SeaweedMessaging_ServiceDesc.Streams[1], "/messaging_pb.SeaweedMessaging/Publish", opts...)
  136. if err != nil {
  137. return nil, err
  138. }
  139. x := &seaweedMessagingPublishClient{stream}
  140. return x, nil
  141. }
  142. type SeaweedMessaging_PublishClient interface {
  143. Send(*PublishRequest) error
  144. Recv() (*PublishResponse, error)
  145. grpc.ClientStream
  146. }
  147. type seaweedMessagingPublishClient struct {
  148. grpc.ClientStream
  149. }
  150. func (x *seaweedMessagingPublishClient) Send(m *PublishRequest) error {
  151. return x.ClientStream.SendMsg(m)
  152. }
  153. func (x *seaweedMessagingPublishClient) Recv() (*PublishResponse, error) {
  154. m := new(PublishResponse)
  155. if err := x.ClientStream.RecvMsg(m); err != nil {
  156. return nil, err
  157. }
  158. return m, nil
  159. }
  160. func (c *seaweedMessagingClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (SeaweedMessaging_SubscribeClient, error) {
  161. stream, err := c.cc.NewStream(ctx, &SeaweedMessaging_ServiceDesc.Streams[2], "/messaging_pb.SeaweedMessaging/Subscribe", opts...)
  162. if err != nil {
  163. return nil, err
  164. }
  165. x := &seaweedMessagingSubscribeClient{stream}
  166. if err := x.ClientStream.SendMsg(in); err != nil {
  167. return nil, err
  168. }
  169. if err := x.ClientStream.CloseSend(); err != nil {
  170. return nil, err
  171. }
  172. return x, nil
  173. }
  174. type SeaweedMessaging_SubscribeClient interface {
  175. Recv() (*SubscribeResponse, error)
  176. grpc.ClientStream
  177. }
  178. type seaweedMessagingSubscribeClient struct {
  179. grpc.ClientStream
  180. }
  181. func (x *seaweedMessagingSubscribeClient) Recv() (*SubscribeResponse, error) {
  182. m := new(SubscribeResponse)
  183. if err := x.ClientStream.RecvMsg(m); err != nil {
  184. return nil, err
  185. }
  186. return m, nil
  187. }
  188. // SeaweedMessagingServer is the server API for SeaweedMessaging service.
  189. // All implementations must embed UnimplementedSeaweedMessagingServer
  190. // for forward compatibility
  191. type SeaweedMessagingServer interface {
  192. // control plane
  193. FindBrokerLeader(context.Context, *FindBrokerLeaderRequest) (*FindBrokerLeaderResponse, error)
  194. AssignSegmentBrokers(context.Context, *AssignSegmentBrokersRequest) (*AssignSegmentBrokersResponse, error)
  195. CheckSegmentStatus(context.Context, *CheckSegmentStatusRequest) (*CheckSegmentStatusResponse, error)
  196. CheckBrokerLoad(context.Context, *CheckBrokerLoadRequest) (*CheckBrokerLoadResponse, error)
  197. // control plane for balancer
  198. ConnectToBalancer(SeaweedMessaging_ConnectToBalancerServer) error
  199. // control plane for topic partitions
  200. LookupTopicBrokers(context.Context, *LookupTopicBrokersRequest) (*LookupTopicBrokersResponse, error)
  201. // a pub client will call this to get the topic partitions assignment
  202. RequestTopicPartitions(context.Context, *RequestTopicPartitionsRequest) (*RequestTopicPartitionsResponse, error)
  203. AssignTopicPartitions(context.Context, *AssignTopicPartitionsRequest) (*AssignTopicPartitionsResponse, error)
  204. CheckTopicPartitionsStatus(context.Context, *CheckTopicPartitionsStatusRequest) (*CheckTopicPartitionsStatusResponse, error)
  205. // data plane
  206. Publish(SeaweedMessaging_PublishServer) error
  207. Subscribe(*SubscribeRequest, SeaweedMessaging_SubscribeServer) error
  208. mustEmbedUnimplementedSeaweedMessagingServer()
  209. }
  210. // UnimplementedSeaweedMessagingServer must be embedded to have forward compatible implementations.
  211. type UnimplementedSeaweedMessagingServer struct {
  212. }
  213. func (UnimplementedSeaweedMessagingServer) FindBrokerLeader(context.Context, *FindBrokerLeaderRequest) (*FindBrokerLeaderResponse, error) {
  214. return nil, status.Errorf(codes.Unimplemented, "method FindBrokerLeader not implemented")
  215. }
  216. func (UnimplementedSeaweedMessagingServer) AssignSegmentBrokers(context.Context, *AssignSegmentBrokersRequest) (*AssignSegmentBrokersResponse, error) {
  217. return nil, status.Errorf(codes.Unimplemented, "method AssignSegmentBrokers not implemented")
  218. }
  219. func (UnimplementedSeaweedMessagingServer) CheckSegmentStatus(context.Context, *CheckSegmentStatusRequest) (*CheckSegmentStatusResponse, error) {
  220. return nil, status.Errorf(codes.Unimplemented, "method CheckSegmentStatus not implemented")
  221. }
  222. func (UnimplementedSeaweedMessagingServer) CheckBrokerLoad(context.Context, *CheckBrokerLoadRequest) (*CheckBrokerLoadResponse, error) {
  223. return nil, status.Errorf(codes.Unimplemented, "method CheckBrokerLoad not implemented")
  224. }
  225. func (UnimplementedSeaweedMessagingServer) ConnectToBalancer(SeaweedMessaging_ConnectToBalancerServer) error {
  226. return status.Errorf(codes.Unimplemented, "method ConnectToBalancer not implemented")
  227. }
  228. func (UnimplementedSeaweedMessagingServer) LookupTopicBrokers(context.Context, *LookupTopicBrokersRequest) (*LookupTopicBrokersResponse, error) {
  229. return nil, status.Errorf(codes.Unimplemented, "method LookupTopicBrokers not implemented")
  230. }
  231. func (UnimplementedSeaweedMessagingServer) RequestTopicPartitions(context.Context, *RequestTopicPartitionsRequest) (*RequestTopicPartitionsResponse, error) {
  232. return nil, status.Errorf(codes.Unimplemented, "method RequestTopicPartitions not implemented")
  233. }
  234. func (UnimplementedSeaweedMessagingServer) AssignTopicPartitions(context.Context, *AssignTopicPartitionsRequest) (*AssignTopicPartitionsResponse, error) {
  235. return nil, status.Errorf(codes.Unimplemented, "method AssignTopicPartitions not implemented")
  236. }
  237. func (UnimplementedSeaweedMessagingServer) CheckTopicPartitionsStatus(context.Context, *CheckTopicPartitionsStatusRequest) (*CheckTopicPartitionsStatusResponse, error) {
  238. return nil, status.Errorf(codes.Unimplemented, "method CheckTopicPartitionsStatus not implemented")
  239. }
  240. func (UnimplementedSeaweedMessagingServer) Publish(SeaweedMessaging_PublishServer) error {
  241. return status.Errorf(codes.Unimplemented, "method Publish not implemented")
  242. }
  243. func (UnimplementedSeaweedMessagingServer) Subscribe(*SubscribeRequest, SeaweedMessaging_SubscribeServer) error {
  244. return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
  245. }
  246. func (UnimplementedSeaweedMessagingServer) mustEmbedUnimplementedSeaweedMessagingServer() {}
  247. // UnsafeSeaweedMessagingServer may be embedded to opt out of forward compatibility for this service.
  248. // Use of this interface is not recommended, as added methods to SeaweedMessagingServer will
  249. // result in compilation errors.
  250. type UnsafeSeaweedMessagingServer interface {
  251. mustEmbedUnimplementedSeaweedMessagingServer()
  252. }
  253. func RegisterSeaweedMessagingServer(s grpc.ServiceRegistrar, srv SeaweedMessagingServer) {
  254. s.RegisterService(&SeaweedMessaging_ServiceDesc, srv)
  255. }
  256. func _SeaweedMessaging_FindBrokerLeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  257. in := new(FindBrokerLeaderRequest)
  258. if err := dec(in); err != nil {
  259. return nil, err
  260. }
  261. if interceptor == nil {
  262. return srv.(SeaweedMessagingServer).FindBrokerLeader(ctx, in)
  263. }
  264. info := &grpc.UnaryServerInfo{
  265. Server: srv,
  266. FullMethod: "/messaging_pb.SeaweedMessaging/FindBrokerLeader",
  267. }
  268. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  269. return srv.(SeaweedMessagingServer).FindBrokerLeader(ctx, req.(*FindBrokerLeaderRequest))
  270. }
  271. return interceptor(ctx, in, info, handler)
  272. }
  273. func _SeaweedMessaging_AssignSegmentBrokers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  274. in := new(AssignSegmentBrokersRequest)
  275. if err := dec(in); err != nil {
  276. return nil, err
  277. }
  278. if interceptor == nil {
  279. return srv.(SeaweedMessagingServer).AssignSegmentBrokers(ctx, in)
  280. }
  281. info := &grpc.UnaryServerInfo{
  282. Server: srv,
  283. FullMethod: "/messaging_pb.SeaweedMessaging/AssignSegmentBrokers",
  284. }
  285. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  286. return srv.(SeaweedMessagingServer).AssignSegmentBrokers(ctx, req.(*AssignSegmentBrokersRequest))
  287. }
  288. return interceptor(ctx, in, info, handler)
  289. }
  290. func _SeaweedMessaging_CheckSegmentStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  291. in := new(CheckSegmentStatusRequest)
  292. if err := dec(in); err != nil {
  293. return nil, err
  294. }
  295. if interceptor == nil {
  296. return srv.(SeaweedMessagingServer).CheckSegmentStatus(ctx, in)
  297. }
  298. info := &grpc.UnaryServerInfo{
  299. Server: srv,
  300. FullMethod: "/messaging_pb.SeaweedMessaging/CheckSegmentStatus",
  301. }
  302. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  303. return srv.(SeaweedMessagingServer).CheckSegmentStatus(ctx, req.(*CheckSegmentStatusRequest))
  304. }
  305. return interceptor(ctx, in, info, handler)
  306. }
  307. func _SeaweedMessaging_CheckBrokerLoad_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  308. in := new(CheckBrokerLoadRequest)
  309. if err := dec(in); err != nil {
  310. return nil, err
  311. }
  312. if interceptor == nil {
  313. return srv.(SeaweedMessagingServer).CheckBrokerLoad(ctx, in)
  314. }
  315. info := &grpc.UnaryServerInfo{
  316. Server: srv,
  317. FullMethod: "/messaging_pb.SeaweedMessaging/CheckBrokerLoad",
  318. }
  319. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  320. return srv.(SeaweedMessagingServer).CheckBrokerLoad(ctx, req.(*CheckBrokerLoadRequest))
  321. }
  322. return interceptor(ctx, in, info, handler)
  323. }
  324. func _SeaweedMessaging_ConnectToBalancer_Handler(srv interface{}, stream grpc.ServerStream) error {
  325. return srv.(SeaweedMessagingServer).ConnectToBalancer(&seaweedMessagingConnectToBalancerServer{stream})
  326. }
  327. type SeaweedMessaging_ConnectToBalancerServer interface {
  328. Send(*ConnectToBalancerResponse) error
  329. Recv() (*ConnectToBalancerRequest, error)
  330. grpc.ServerStream
  331. }
  332. type seaweedMessagingConnectToBalancerServer struct {
  333. grpc.ServerStream
  334. }
  335. func (x *seaweedMessagingConnectToBalancerServer) Send(m *ConnectToBalancerResponse) error {
  336. return x.ServerStream.SendMsg(m)
  337. }
  338. func (x *seaweedMessagingConnectToBalancerServer) Recv() (*ConnectToBalancerRequest, error) {
  339. m := new(ConnectToBalancerRequest)
  340. if err := x.ServerStream.RecvMsg(m); err != nil {
  341. return nil, err
  342. }
  343. return m, nil
  344. }
  345. func _SeaweedMessaging_LookupTopicBrokers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  346. in := new(LookupTopicBrokersRequest)
  347. if err := dec(in); err != nil {
  348. return nil, err
  349. }
  350. if interceptor == nil {
  351. return srv.(SeaweedMessagingServer).LookupTopicBrokers(ctx, in)
  352. }
  353. info := &grpc.UnaryServerInfo{
  354. Server: srv,
  355. FullMethod: "/messaging_pb.SeaweedMessaging/LookupTopicBrokers",
  356. }
  357. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  358. return srv.(SeaweedMessagingServer).LookupTopicBrokers(ctx, req.(*LookupTopicBrokersRequest))
  359. }
  360. return interceptor(ctx, in, info, handler)
  361. }
  362. func _SeaweedMessaging_RequestTopicPartitions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  363. in := new(RequestTopicPartitionsRequest)
  364. if err := dec(in); err != nil {
  365. return nil, err
  366. }
  367. if interceptor == nil {
  368. return srv.(SeaweedMessagingServer).RequestTopicPartitions(ctx, in)
  369. }
  370. info := &grpc.UnaryServerInfo{
  371. Server: srv,
  372. FullMethod: "/messaging_pb.SeaweedMessaging/RequestTopicPartitions",
  373. }
  374. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  375. return srv.(SeaweedMessagingServer).RequestTopicPartitions(ctx, req.(*RequestTopicPartitionsRequest))
  376. }
  377. return interceptor(ctx, in, info, handler)
  378. }
  379. func _SeaweedMessaging_AssignTopicPartitions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  380. in := new(AssignTopicPartitionsRequest)
  381. if err := dec(in); err != nil {
  382. return nil, err
  383. }
  384. if interceptor == nil {
  385. return srv.(SeaweedMessagingServer).AssignTopicPartitions(ctx, in)
  386. }
  387. info := &grpc.UnaryServerInfo{
  388. Server: srv,
  389. FullMethod: "/messaging_pb.SeaweedMessaging/AssignTopicPartitions",
  390. }
  391. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  392. return srv.(SeaweedMessagingServer).AssignTopicPartitions(ctx, req.(*AssignTopicPartitionsRequest))
  393. }
  394. return interceptor(ctx, in, info, handler)
  395. }
  396. func _SeaweedMessaging_CheckTopicPartitionsStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  397. in := new(CheckTopicPartitionsStatusRequest)
  398. if err := dec(in); err != nil {
  399. return nil, err
  400. }
  401. if interceptor == nil {
  402. return srv.(SeaweedMessagingServer).CheckTopicPartitionsStatus(ctx, in)
  403. }
  404. info := &grpc.UnaryServerInfo{
  405. Server: srv,
  406. FullMethod: "/messaging_pb.SeaweedMessaging/CheckTopicPartitionsStatus",
  407. }
  408. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  409. return srv.(SeaweedMessagingServer).CheckTopicPartitionsStatus(ctx, req.(*CheckTopicPartitionsStatusRequest))
  410. }
  411. return interceptor(ctx, in, info, handler)
  412. }
  413. func _SeaweedMessaging_Publish_Handler(srv interface{}, stream grpc.ServerStream) error {
  414. return srv.(SeaweedMessagingServer).Publish(&seaweedMessagingPublishServer{stream})
  415. }
  416. type SeaweedMessaging_PublishServer interface {
  417. Send(*PublishResponse) error
  418. Recv() (*PublishRequest, error)
  419. grpc.ServerStream
  420. }
  421. type seaweedMessagingPublishServer struct {
  422. grpc.ServerStream
  423. }
  424. func (x *seaweedMessagingPublishServer) Send(m *PublishResponse) error {
  425. return x.ServerStream.SendMsg(m)
  426. }
  427. func (x *seaweedMessagingPublishServer) Recv() (*PublishRequest, error) {
  428. m := new(PublishRequest)
  429. if err := x.ServerStream.RecvMsg(m); err != nil {
  430. return nil, err
  431. }
  432. return m, nil
  433. }
  434. func _SeaweedMessaging_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
  435. m := new(SubscribeRequest)
  436. if err := stream.RecvMsg(m); err != nil {
  437. return err
  438. }
  439. return srv.(SeaweedMessagingServer).Subscribe(m, &seaweedMessagingSubscribeServer{stream})
  440. }
  441. type SeaweedMessaging_SubscribeServer interface {
  442. Send(*SubscribeResponse) error
  443. grpc.ServerStream
  444. }
  445. type seaweedMessagingSubscribeServer struct {
  446. grpc.ServerStream
  447. }
  448. func (x *seaweedMessagingSubscribeServer) Send(m *SubscribeResponse) error {
  449. return x.ServerStream.SendMsg(m)
  450. }
  451. // SeaweedMessaging_ServiceDesc is the grpc.ServiceDesc for SeaweedMessaging service.
  452. // It's only intended for direct use with grpc.RegisterService,
  453. // and not to be introspected or modified (even as a copy)
  454. var SeaweedMessaging_ServiceDesc = grpc.ServiceDesc{
  455. ServiceName: "messaging_pb.SeaweedMessaging",
  456. HandlerType: (*SeaweedMessagingServer)(nil),
  457. Methods: []grpc.MethodDesc{
  458. {
  459. MethodName: "FindBrokerLeader",
  460. Handler: _SeaweedMessaging_FindBrokerLeader_Handler,
  461. },
  462. {
  463. MethodName: "AssignSegmentBrokers",
  464. Handler: _SeaweedMessaging_AssignSegmentBrokers_Handler,
  465. },
  466. {
  467. MethodName: "CheckSegmentStatus",
  468. Handler: _SeaweedMessaging_CheckSegmentStatus_Handler,
  469. },
  470. {
  471. MethodName: "CheckBrokerLoad",
  472. Handler: _SeaweedMessaging_CheckBrokerLoad_Handler,
  473. },
  474. {
  475. MethodName: "LookupTopicBrokers",
  476. Handler: _SeaweedMessaging_LookupTopicBrokers_Handler,
  477. },
  478. {
  479. MethodName: "RequestTopicPartitions",
  480. Handler: _SeaweedMessaging_RequestTopicPartitions_Handler,
  481. },
  482. {
  483. MethodName: "AssignTopicPartitions",
  484. Handler: _SeaweedMessaging_AssignTopicPartitions_Handler,
  485. },
  486. {
  487. MethodName: "CheckTopicPartitionsStatus",
  488. Handler: _SeaweedMessaging_CheckTopicPartitionsStatus_Handler,
  489. },
  490. },
  491. Streams: []grpc.StreamDesc{
  492. {
  493. StreamName: "ConnectToBalancer",
  494. Handler: _SeaweedMessaging_ConnectToBalancer_Handler,
  495. ServerStreams: true,
  496. ClientStreams: true,
  497. },
  498. {
  499. StreamName: "Publish",
  500. Handler: _SeaweedMessaging_Publish_Handler,
  501. ServerStreams: true,
  502. ClientStreams: true,
  503. },
  504. {
  505. StreamName: "Subscribe",
  506. Handler: _SeaweedMessaging_Subscribe_Handler,
  507. ServerStreams: true,
  508. },
  509. },
  510. Metadata: "mq.proto",
  511. }