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.

639 lines
25 KiB

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