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.

692 lines
28 KiB

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